home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / NoteAttributeDialog.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-19  |  80.4 KB  |  2,368 lines  |  [TEXT/KAHL]

  1. /* NoteAttributeDialog.c */
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /*    Out Of Phase:  Digital Music Synthesis on General Purpose Computers    */
  5. /*    Copyright (C) 1994  Thomas R. Lawrence                                 */
  6. /*                                                                           */
  7. /*    This program is free software; you can redistribute it and/or modify   */
  8. /*    it under the terms of the GNU General Public License as published by   */
  9. /*    the Free Software Foundation; either version 2 of the License, or      */
  10. /*    (at your option) any later version.                                    */
  11. /*                                                                           */
  12. /*    This program is distributed in the hope that it will be useful,        */
  13. /*    but WITHOUT ANY WARRANTY; without even the implied warranty of         */
  14. /*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
  15. /*    GNU General Public License for more details.                           */
  16. /*                                                                           */
  17. /*    You should have received a copy of the GNU General Public License      */
  18. /*    along with this program; if not, write to the Free Software            */
  19. /*    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */
  20. /*                                                                           */
  21. /*    Thomas R. Lawrence can be reached at tomlaw@world.std.com.             */
  22. /*                                                                           */
  23. /*****************************************************************************/
  24.  
  25. #include "MiscInfo.h"
  26. #include "Audit.h"
  27. #include "Debug.h"
  28. #include "Definitions.h"
  29.  
  30. #include "NoteAttributeDialog.h"
  31. #include "Memory.h"
  32. #include "NoteObject.h"
  33. #include "Screen.h"
  34. #include "Main.h"
  35. #include "Menus.h"
  36. #include "EventLoop.h"
  37. #include "SimpleButton.h"
  38. #include "TextEdit.h"
  39. #include "RadioButton.h"
  40. #include "Alert.h"
  41. #include "Numbers.h"
  42. #include "WrapTextBox.h"
  43. #include "SymbolicDuration.h"
  44. #include "SymbolicPitch.h"
  45. #include "DataMunging.h"
  46. #include "SymbolicIsItInThere.h"
  47. #include "CheckBox.h"
  48. #include "TrackObject.h"
  49.  
  50.  
  51. #define WINXSIZE (500)
  52.  
  53. #define INDENTVALUE (80)
  54.  
  55. #define BUTTON1WIDTH (50)
  56. #define BUTTON2WIDTH (70)
  57. #define BUTTON3WIDTH (60)
  58.  
  59. #define DESCRIPTIONX (10)
  60. #define DESCRIPTIONY (6)
  61. #define DESCRIPTIONWIDTH (WINXSIZE - DESCRIPTIONX - DESCRIPTIONX)
  62. #define DESCRIPTIONHEIGHT (15)
  63.  
  64. #define EARLYLATEADJUSTPROMPTX (DESCRIPTIONX)
  65. #define EARLYLATEADJUSTPROMPTY (DESCRIPTIONY + DESCRIPTIONHEIGHT + 3 + 5)
  66.  
  67. #define EARLYLATEADJUSTEDITX (EARLYLATEADJUSTPROMPTX + INDENTVALUE)
  68. #define EARLYLATEADJUSTEDITY (EARLYLATEADJUSTPROMPTY - 3)
  69. #define EARLYLATEADJUSTEDITWIDTH (70)
  70. #define EARLYLATEADJUSTEDITHEIGHT (19)
  71.  
  72. #define RELEASE1PROMPTX (EARLYLATEADJUSTEDITX + EARLYLATEADJUSTEDITWIDTH + 10)
  73. #define RELEASE1PROMPTY (EARLYLATEADJUSTPROMPTY)
  74.  
  75. #define RELEASE1EDITX (RELEASE1PROMPTX + INDENTVALUE)
  76. #define RELEASE1EDITY (RELEASE1PROMPTY - 3)
  77. #define RELEASE1EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  78. #define RELEASE1EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  79.  
  80. #define RELEASE1STARTBUTTONX (RELEASE1EDITX + RELEASE1EDITWIDTH + 5)
  81. #define RELEASE1STARTBUTTONY (RELEASE1EDITY)
  82. #define RELEASE1STARTBUTTONWIDTH (BUTTON1WIDTH)
  83. #define RELEASE1STARTBUTTONHEIGHT (RELEASE1EDITHEIGHT)
  84.  
  85. #define RELEASE1ENDBUTTONX (RELEASE1STARTBUTTONX + RELEASE1STARTBUTTONWIDTH)
  86. #define RELEASE1ENDBUTTONY (RELEASE1STARTBUTTONY)
  87. #define RELEASE1ENDBUTTONWIDTH (BUTTON2WIDTH)
  88. #define RELEASE1ENDBUTTONHEIGHT (RELEASE1STARTBUTTONHEIGHT)
  89.  
  90. #define RELEASE1DEFAULTBUTTONX (RELEASE1ENDBUTTONX + RELEASE1ENDBUTTONWIDTH)
  91. #define RELEASE1DEFAULTBUTTONY (RELEASE1ENDBUTTONY)
  92. #define RELEASE1DEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  93. #define RELEASE1DEFAULTBUTTONHEIGHT (RELEASE1ENDBUTTONHEIGHT)
  94.  
  95. #define LOUDNESSPROMPTX (EARLYLATEADJUSTPROMPTX)
  96. #define LOUDNESSPROMPTY (EARLYLATEADJUSTPROMPTY + EARLYLATEADJUSTEDITHEIGHT - 1)
  97.  
  98. #define LOUDNESSEDITX (LOUDNESSPROMPTX + INDENTVALUE)
  99. #define LOUDNESSEDITY (LOUDNESSPROMPTY - 3)
  100. #define LOUDNESSEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  101. #define LOUDNESSEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  102.  
  103. #define RELEASE2PROMPTX (LOUDNESSEDITX + LOUDNESSEDITWIDTH + 10)
  104. #define RELEASE2PROMPTY (LOUDNESSPROMPTY)
  105.  
  106. #define RELEASE2EDITX (RELEASE2PROMPTX + INDENTVALUE)
  107. #define RELEASE2EDITY (RELEASE2PROMPTY - 3)
  108. #define RELEASE2EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  109. #define RELEASE2EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  110.  
  111. #define RELEASE2STARTBUTTONX (RELEASE2EDITX + RELEASE2EDITWIDTH + 5)
  112. #define RELEASE2STARTBUTTONY (RELEASE2EDITY)
  113. #define RELEASE2STARTBUTTONWIDTH (BUTTON1WIDTH)
  114. #define RELEASE2STARTBUTTONHEIGHT (RELEASE2EDITHEIGHT)
  115.  
  116. #define RELEASE2ENDBUTTONX (RELEASE2STARTBUTTONX + RELEASE2STARTBUTTONWIDTH)
  117. #define RELEASE2ENDBUTTONY (RELEASE2STARTBUTTONY)
  118. #define RELEASE2ENDBUTTONWIDTH (BUTTON2WIDTH)
  119. #define RELEASE2ENDBUTTONHEIGHT (RELEASE2STARTBUTTONHEIGHT)
  120.  
  121. #define RELEASE2DEFAULTBUTTONX (RELEASE2ENDBUTTONX + RELEASE2ENDBUTTONWIDTH)
  122. #define RELEASE2DEFAULTBUTTONY (RELEASE2ENDBUTTONY)
  123. #define RELEASE2DEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  124. #define RELEASE2DEFAULTBUTTONHEIGHT (RELEASE2ENDBUTTONHEIGHT)
  125.  
  126. #define ACCENT1PROMPTX (EARLYLATEADJUSTPROMPTX)
  127. #define ACCENT1PROMPTY (LOUDNESSPROMPTY + LOUDNESSEDITHEIGHT - 1)
  128.  
  129. #define ACCENT1EDITX (ACCENT1PROMPTX + INDENTVALUE)
  130. #define ACCENT1EDITY (ACCENT1PROMPTY - 3)
  131. #define ACCENT1EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  132. #define ACCENT1EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  133.  
  134. #define ACCENT2PROMPTX (ACCENT1EDITX + ACCENT1EDITWIDTH + 10)
  135. #define ACCENT2PROMPTY (ACCENT1PROMPTY)
  136.  
  137. #define ACCENT2EDITX (ACCENT2PROMPTX + INDENTVALUE)
  138. #define ACCENT2EDITY (ACCENT2PROMPTY - 3)
  139. #define ACCENT2EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  140. #define ACCENT2EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  141.  
  142. #define ACCENT3PROMPTX (EARLYLATEADJUSTPROMPTX)
  143. #define ACCENT3PROMPTY (ACCENT1PROMPTY + ACCENT1EDITHEIGHT - 1)
  144.  
  145. #define ACCENT3EDITX (ACCENT3PROMPTX + INDENTVALUE)
  146. #define ACCENT3EDITY (ACCENT3PROMPTY - 3)
  147. #define ACCENT3EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  148. #define ACCENT3EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  149.  
  150. #define ACCENT4PROMPTX (ACCENT3EDITX + ACCENT3EDITWIDTH + 10)
  151. #define ACCENT4PROMPTY (ACCENT3PROMPTY)
  152.  
  153. #define ACCENT4EDITX (ACCENT4PROMPTX + INDENTVALUE)
  154. #define ACCENT4EDITY (ACCENT4PROMPTY - 3)
  155. #define ACCENT4EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  156. #define ACCENT4EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  157.  
  158. #define PITCHDISPRATEPROMPTX (EARLYLATEADJUSTPROMPTX)
  159. #define PITCHDISPRATEPROMPTY (ACCENT3PROMPTY + ACCENT3EDITHEIGHT - 1)
  160.  
  161. #define PITCHDISPRATEEDITX (PITCHDISPRATEPROMPTX + INDENTVALUE)
  162. #define PITCHDISPRATEEDITY (PITCHDISPRATEPROMPTY - 3)
  163. #define PITCHDISPRATEEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  164. #define PTICHDISPRATEEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  165.  
  166. #define PITCHDISPDEPTHPROMPTX (PITCHDISPRATEEDITX + PITCHDISPRATEEDITWIDTH + 10)
  167. #define PITCHDISPDEPTHPROMPTY (PITCHDISPRATEPROMPTY)
  168.  
  169. #define PITCHDISPDEPTHEDITX (PITCHDISPDEPTHPROMPTX + INDENTVALUE)
  170. #define PITCHDISPDEPTHEDITY (PITCHDISPDEPTHPROMPTY - 3)
  171. #define PITCHDISPDEPTHEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  172. #define PITCHDISPDEPTHEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  173.  
  174. #define HURRYUPPROMPTX (EARLYLATEADJUSTPROMPTX)
  175. #define HURRYUPPROMPTY (PITCHDISPRATEPROMPTY + PTICHDISPRATEEDITHEIGHT - 1)
  176.  
  177. #define HURRYUPEDITX (HURRYUPPROMPTX + INDENTVALUE)
  178. #define HURRYUPEDITY (HURRYUPPROMPTY - 3)
  179. #define HURRYUPEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  180. #define HURRYUPEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  181.  
  182. #define PITCHDISPSTARTPROMPTX (HURRYUPEDITX + HURRYUPEDITWIDTH + 10)
  183. #define PITCHDISPSTARTPROMPTY (HURRYUPPROMPTY)
  184.  
  185. #define PITCHDISPSTARTEDITX (PITCHDISPSTARTPROMPTX + INDENTVALUE)
  186. #define PITCHDISPSTARTEDITY (PITCHDISPSTARTPROMPTY - 3)
  187. #define PITCHDISPSTARTEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  188. #define PITCHDISPSTARTEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  189.  
  190. #define PITCHDISPSTARTSTARTBUTTONX (PITCHDISPSTARTEDITX + PITCHDISPSTARTEDITWIDTH + 5)
  191. #define PITCHDISPSTARTSTARTBUTTONY (PITCHDISPSTARTEDITY)
  192. #define PITCHDISPSTARTSTARTBUTTONWIDTH (BUTTON1WIDTH)
  193. #define PITCHDISPSTARTSTARTBUTTONHEIGHT (PITCHDISPSTARTEDITHEIGHT)
  194.  
  195. #define PITCHDISPSTARTENDBUTTONX (PITCHDISPSTARTSTARTBUTTONX\
  196.                     + PITCHDISPSTARTSTARTBUTTONWIDTH)
  197. #define PITCHDISPSTARTENDBUTTONY (PITCHDISPSTARTSTARTBUTTONY)
  198. #define PITCHDISPSTARTENDBUTTONWIDTH (BUTTON2WIDTH)
  199. #define PITCHDISPSTARTENDBUTTONHEIGHT (PITCHDISPSTARTSTARTBUTTONHEIGHT)
  200.  
  201. #define PITCHDISPSTARTDEFAULTBUTTONX (PITCHDISPSTARTENDBUTTONX\
  202.                     + PITCHDISPSTARTENDBUTTONWIDTH)
  203. #define PITCHDISPSTARTDEFAULTBUTTONY (PITCHDISPSTARTENDBUTTONY)
  204. #define PITCHDISPSTARTDEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  205. #define PITCHDISPSTARTDEFAULTBUTTONHEIGHT (PITCHDISPSTARTENDBUTTONHEIGHT)
  206.  
  207. #define STEREOPOSPROMPTX (EARLYLATEADJUSTPROMPTX)
  208. #define STEREOPOSPROMPTY (HURRYUPPROMPTY + HURRYUPEDITHEIGHT - 1)
  209.  
  210. #define STEREOPOSEDITX (STEREOPOSPROMPTX + INDENTVALUE)
  211. #define STEREOPOSEDITY (STEREOPOSPROMPTY - 3)
  212. #define STEREOPOSEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  213. #define STEREOPOSEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  214.  
  215. #define DETUNEPROMPTX (STEREOPOSEDITX + STEREOPOSEDITWIDTH + 10)
  216. #define DETUNEPROMPTY (STEREOPOSPROMPTY)
  217.  
  218. #define DETUNEEDITX (DETUNEPROMPTX + INDENTVALUE)
  219. #define DETUNEEDITY (DETUNEPROMPTY - 3)
  220. #define DETUNEEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  221. #define DETUNEEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  222.  
  223. #define DETUNEHERTZBUTTONX (DETUNEEDITX + DETUNEEDITWIDTH + 5)
  224. #define DETUNEHERTZBUTTONY (DETUNEEDITY)
  225. #define DETUNEHERTZBUTTONWIDTH (BUTTON1WIDTH)
  226. #define DETUNEHERTZBUTTONHEIGHT (DETUNEEDITHEIGHT)
  227.  
  228. #define DETUNEHALFSTEPBUTTONX (DETUNEHERTZBUTTONX + DETUNEHERTZBUTTONWIDTH)
  229. #define DETUNEHALFSTEPBUTTONY (DETUNEHERTZBUTTONY)
  230. #define DETUNEHALFSTEPBUTTONWIDTH (BUTTON2WIDTH)
  231. #define DETUNEHALFSTEPBUTTONHEIGHT (DETUNEHERTZBUTTONHEIGHT)
  232.  
  233. #define DETUNEDEFAULTBUTTONX (DETUNEHALFSTEPBUTTONX + DETUNEHALFSTEPBUTTONWIDTH)
  234. #define DETUNEDEFAULTBUTTONY (DETUNEHALFSTEPBUTTONY)
  235. #define DETUNEDEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  236. #define DETUNEDEFAULTBUTTONHEIGHT (DETUNEHALFSTEPBUTTONHEIGHT)
  237.  
  238. #define SURROUNDPOSPROMPTX (EARLYLATEADJUSTPROMPTX)
  239. #define SURROUNDPOSPROMPTY (STEREOPOSPROMPTY + STEREOPOSEDITHEIGHT - 1)
  240.  
  241. #define SURROUNDPOSEDITX (SURROUNDPOSPROMPTX + INDENTVALUE)
  242. #define SURROUNDPOSEDITY (SURROUNDPOSPROMPTY - 3)
  243. #define SURROUNDPOSEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  244. #define SURROUNDPOSEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  245.  
  246. #define DURATIONPROMPTX (EARLYLATEADJUSTPROMPTX)
  247. #define DURATIONPROMPTY (SURROUNDPOSPROMPTY + STEREOPOSEDITHEIGHT - 1)
  248.  
  249. #define DURATIONEDITX (DURATIONPROMPTX + INDENTVALUE)
  250. #define DURATIONEDITY (DURATIONPROMPTY - 3)
  251. #define DURATIONEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  252. #define DURATIONEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  253.  
  254. #define DURATIONADJUSTPROMPTX (DURATIONEDITX + DURATIONEDITWIDTH + 10)
  255. #define DURATIONADJUSTPROMPTY (DURATIONPROMPTY)
  256.  
  257. #define DURATIONADJUSTEDITX (DURATIONADJUSTPROMPTX + INDENTVALUE)
  258. #define DURATIONADJUSTEDITY (DURATIONADJUSTPROMPTY - 3)
  259. #define DURATIONADJUSTEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  260. #define DURATIONADJUSTEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  261.  
  262. #define DURATIONADJUSTADDBUTTONX (DURATIONADJUSTEDITX + DURATIONADJUSTEDITWIDTH + 5)
  263. #define DURATIONADJUSTADDBUTTONY (DURATIONADJUSTEDITY)
  264. #define DURATIONADJUSTADDBUTTONWIDTH (BUTTON1WIDTH)
  265. #define DURATIONADJUSTADDBUTTONHEIGHT (DURATIONADJUSTEDITHEIGHT)
  266.  
  267. #define DURATIONADJUSTMULTBUTTONX (DURATIONADJUSTADDBUTTONX\
  268.                     + DURATIONADJUSTADDBUTTONWIDTH)
  269. #define DURATIONADJUSTMULTBUTTONY (DURATIONADJUSTADDBUTTONY)
  270. #define DURATIONADJUSTMULTBUTTONWIDTH (BUTTON2WIDTH)
  271. #define DURATIONADJUSTMULTBOTTONHEIGHT (DURATIONADJUSTADDBUTTONHEIGHT)
  272.  
  273. #define DURATIONADJUSTDEFAULTBUTTONX (DURATIONADJUSTMULTBUTTONX\
  274.                     + DURATIONADJUSTMULTBUTTONWIDTH)
  275. #define DURATIONADJUSTDEFAULTBUTTONY (DURATIONADJUSTMULTBUTTONY)
  276. #define DURATIONADJUSTDEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  277. #define DURATIONADJUSTDEFAULTBUTTONHEIGHT (DURATIONADJUSTMULTBOTTONHEIGHT)
  278.  
  279. #define REALPITCHPROMPTX (EARLYLATEADJUSTPROMPTX)
  280. #define REALPITCHPROMPTY (DURATIONPROMPTY + DURATIONEDITHEIGHT - 1)
  281.  
  282. #define REALPITCHEDITX (REALPITCHPROMPTX + INDENTVALUE)
  283. #define REALPITCHEDITY (REALPITCHPROMPTY - 3)
  284. #define REALPITCHEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  285. #define REALPITCHEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  286.  
  287. #define FAKEPITCHPROMPTX (REALPITCHEDITX + REALPITCHEDITWIDTH + 10)
  288. #define FAKEPITCHPROMPTY (REALPITCHPROMPTY)
  289.  
  290. #define FAKEPITCHEDITX (FAKEPITCHPROMPTX + INDENTVALUE)
  291. #define FAKEPITCHEDITY (FAKEPITCHPROMPTY - 3)
  292. #define FAKEPITCHEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  293. #define FAKEPITCHEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  294.  
  295. #define PORTAMENTOPROMPTX (FAKEPITCHPROMPTX)
  296. #define PORTAMENTOPROMPTY (FAKEPITCHPROMPTY + REALPITCHEDITHEIGHT - 1)
  297.  
  298. #define PORTAMENTOEDITX (PORTAMENTOPROMPTX + INDENTVALUE)
  299. #define PORTAMENTOEDITY (PORTAMENTOPROMPTY - 3)
  300. #define PORTAMENTOEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  301. #define PORTAMENTOEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  302.  
  303. #define PORTAHERTZBUTTONX (PORTAMENTOEDITX + PORTAMENTOEDITWIDTH + 5)
  304. #define PORTAHERTZBUTTONY (PORTAMENTOEDITY)
  305. #define PORTAHERTZBUTTONWIDTH (BUTTON1WIDTH)
  306. #define PORTAHERTZBUTTONHEIGHT (PORTAMENTOEDITHEIGHT)
  307.  
  308. #define PORTAHALFSTEPBUTTONX (PORTAHERTZBUTTONX + PORTAHERTZBUTTONWIDTH)
  309. #define PORTAHALFSTEPBUTTONY (PORTAHERTZBUTTONY)
  310. #define PORTAHALFSTEPBUTTONWIDTH (BUTTON2WIDTH)
  311. #define PORTAHALFSTEPBUTTONHEIGHT (PORTAHERTZBUTTONHEIGHT)
  312.  
  313. #define RESTCHECKBOXX (EARLYLATEADJUSTPROMPTX)
  314. #define RESTCHECKBOXY (PORTAMENTOPROMPTY - 3)
  315. #define RESTCHECKBOXWIDTH (INDENTVALUE + EARLYLATEADJUSTEDITWIDTH)
  316. #define RESTCHECKBOXHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  317.  
  318. #define RETRIGCHECKBOXX (EARLYLATEADJUSTPROMPTX)
  319. #define RETRIGCHECKBOXY (RESTCHECKBOXY + EARLYLATEADJUSTEDITHEIGHT - 1)
  320. #define RETRIGCHECKBOXWIDTH (RESTCHECKBOXWIDTH)
  321. #define RETRIGCHECKBOXHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  322.  
  323. #define RELEASE3CHECKBOXX (RETRIGCHECKBOXX + INDENTVALUE + EARLYLATEADJUSTEDITWIDTH + 10)
  324. #define RELEASE3CHECKBOXY (RETRIGCHECKBOXY)
  325. #define RELEASE3CHECKBOXWIDTH (RESTCHECKBOXWIDTH)
  326. #define RELEASE3CHECKBOXHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  327.  
  328. #define OKBUTTONWIDTH (80)
  329. #define OKBUTTONHEIGHT (21)
  330. #define OKBUTTONY (RETRIGCHECKBOXY + RETRIGCHECKBOXHEIGHT + 15)
  331. #define OKBUTTONX ((WINXSIZE / 4) - (OKBUTTONWIDTH / 2))
  332.  
  333. #define CANCELBUTTONWIDTH (OKBUTTONWIDTH)
  334. #define CANCELBUTTONHEIGHT (OKBUTTONHEIGHT)
  335. #define CANCELBUTTONY (OKBUTTONY)
  336. #define CANCELBUTTONX (((3 * WINXSIZE) / 4) - (OKBUTTONWIDTH / 2))
  337.  
  338. #define WINYSIZE (CANCELBUTTONY + CANCELBUTTONHEIGHT + 10)
  339.  
  340.  
  341. typedef struct
  342.     {
  343.         WinType*                        ScreenID;
  344.         SimpleButtonRec*        OKButton;
  345.         SimpleButtonRec*        CancelButton;
  346.         TextEditRec*                EarlyLateEdit;
  347.         TextEditRec*                Release1Edit;
  348.         RadioButtonRec*            Release1StartButton;
  349.         RadioButtonRec*            Release1EndButton;
  350.         RadioButtonRec*            Release1DefaultButton;
  351.         TextEditRec*                LoudnessEdit;
  352.         TextEditRec*                Release2Edit;
  353.         RadioButtonRec*            Release2StartButton;
  354.         RadioButtonRec*            Release2EndButton;
  355.         RadioButtonRec*            Release2DefaultButton;
  356.         TextEditRec*                Accent1Edit;
  357.         TextEditRec*                Accent2Edit;
  358.         TextEditRec*                Accent3Edit;
  359.         TextEditRec*                Accent4Edit;
  360.         TextEditRec*                PitchDispRateEdit;
  361.         TextEditRec*                PitchDispDepthEdit;
  362.         TextEditRec*                HurryUpEdit;
  363.         TextEditRec*                PitchDispStartEdit;
  364.         RadioButtonRec*            PitchDispStartStartButton;
  365.         RadioButtonRec*            PitchDispStartEndButton;
  366.         RadioButtonRec*            PitchDispStartDefaultButton;
  367.         TextEditRec*                StereoPosEdit;
  368.         TextEditRec*                DetuneEdit;
  369.         RadioButtonRec*            DetuneHertzButton;
  370.         RadioButtonRec*            DetuneHalfstepButton;
  371.         RadioButtonRec*            DetuneDefaultButton;
  372.         TextEditRec*                SurroundPosEdit;
  373.         TextEditRec*                DurationEdit;
  374.         TextEditRec*                DurationAdjustEdit;
  375.         RadioButtonRec*            DurationAdjustAddButton;
  376.         RadioButtonRec*            DurationAdjustMultButton;
  377.         RadioButtonRec*            DurationAdjustDefaultButton;
  378.         TextEditRec*                RealPitchEdit;
  379.         TextEditRec*                FakePitchEdit;
  380.         TextEditRec*                PortamentoEdit;
  381.         CheckBoxRec*                RestBox;
  382.         RadioButtonRec*            PortaHertzButton;
  383.         RadioButtonRec*            PortaHalfstepButton;
  384.         CheckBoxRec*                RetrigBox;
  385.         CheckBoxRec*                Release3Box;
  386.     } WindowRec;
  387.  
  388.  
  389. static void                    UpdateTheWindow(WindowRec* Window)
  390.     {
  391.         CheckPtrExistence(Window);
  392.         RedrawSimpleButton(Window->OKButton);
  393.         RedrawSimpleButton(Window->CancelButton);
  394.         TextEditFullRedraw(Window->EarlyLateEdit);
  395.         TextEditFullRedraw(Window->Release1Edit);
  396.         RedrawRadioButton(Window->Release1StartButton);
  397.         RedrawRadioButton(Window->Release1EndButton);
  398.         RedrawRadioButton(Window->Release1DefaultButton);
  399.         TextEditFullRedraw(Window->LoudnessEdit);
  400.         TextEditFullRedraw(Window->Release2Edit);
  401.         RedrawRadioButton(Window->Release2StartButton);
  402.         RedrawRadioButton(Window->Release2EndButton);
  403.         RedrawRadioButton(Window->Release2DefaultButton);
  404.         TextEditFullRedraw(Window->Accent1Edit);
  405.         TextEditFullRedraw(Window->Accent2Edit);
  406.         TextEditFullRedraw(Window->Accent3Edit);
  407.         TextEditFullRedraw(Window->Accent4Edit);
  408.         TextEditFullRedraw(Window->PitchDispRateEdit);
  409.         TextEditFullRedraw(Window->PitchDispDepthEdit);
  410.         TextEditFullRedraw(Window->HurryUpEdit);
  411.         TextEditFullRedraw(Window->PitchDispStartEdit);
  412.         RedrawRadioButton(Window->PitchDispStartStartButton);
  413.         RedrawRadioButton(Window->PitchDispStartEndButton);
  414.         RedrawRadioButton(Window->PitchDispStartDefaultButton);
  415.         TextEditFullRedraw(Window->StereoPosEdit);
  416.         TextEditFullRedraw(Window->DetuneEdit);
  417.         RedrawRadioButton(Window->DetuneHertzButton);
  418.         RedrawRadioButton(Window->DetuneHalfstepButton);
  419.         RedrawRadioButton(Window->DetuneDefaultButton);
  420.         TextEditFullRedraw(Window->SurroundPosEdit);
  421.         TextEditFullRedraw(Window->DurationEdit);
  422.         TextEditFullRedraw(Window->DurationAdjustEdit);
  423.         RedrawRadioButton(Window->DurationAdjustAddButton);
  424.         RedrawRadioButton(Window->DurationAdjustMultButton);
  425.         RedrawRadioButton(Window->DurationAdjustDefaultButton);
  426.         TextEditFullRedraw(Window->RealPitchEdit);
  427.         TextEditFullRedraw(Window->FakePitchEdit);
  428.         TextEditFullRedraw(Window->PortamentoEdit);
  429.         RedrawCheckBox(Window->RestBox);
  430.         RedrawRadioButton(Window->PortaHertzButton);
  431.         RedrawRadioButton(Window->PortaHalfstepButton);
  432.         RedrawCheckBox(Window->RetrigBox);
  433.         RedrawCheckBox(Window->Release3Box);
  434.         SetClipRect(Window->ScreenID,0,0,WINXSIZE,WINYSIZE);
  435.         DrawWrappedTextBox(Window->ScreenID,"Adjust the note's attributes:",
  436.             GetScreenFont(),9,DESCRIPTIONX,DESCRIPTIONY,DESCRIPTIONWIDTH,DESCRIPTIONHEIGHT);
  437.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Hit Time:",9,
  438.             EARLYLATEADJUSTPROMPTX,EARLYLATEADJUSTPROMPTY,ePlain);
  439.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Release 1:",10,
  440.             RELEASE1PROMPTX,RELEASE1PROMPTY,ePlain);
  441.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Loudness:",9,
  442.             LOUDNESSPROMPTX,LOUDNESSPROMPTY,ePlain);
  443.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Release 2:",10,
  444.             RELEASE2PROMPTX,RELEASE2PROMPTY,ePlain);
  445.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 1:",9,
  446.             ACCENT1PROMPTX,ACCENT1PROMPTY,ePlain);
  447.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 2:",9,
  448.             ACCENT2PROMPTX,ACCENT2PROMPTY,ePlain);
  449.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 3:",9,
  450.             ACCENT3PROMPTX,ACCENT3PROMPTY,ePlain);
  451.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 4:",9,
  452.             ACCENT4PROMPTX,ACCENT4PROMPTY,ePlain);
  453.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Pitch Disp Rate:",16,
  454.             PITCHDISPRATEPROMPTX,PITCHDISPRATEPROMPTY,ePlain);
  455.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Pitch Disp Depth:",17,
  456.             PITCHDISPDEPTHPROMPTX,PITCHDISPDEPTHPROMPTY,ePlain);
  457.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Hurry-Up:",9,
  458.             HURRYUPPROMPTX,HURRYUPPROMPTY,ePlain);
  459.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Pitch Disp Start:",17,
  460.             PITCHDISPSTARTPROMPTX,PITCHDISPSTARTPROMPTY,ePlain);
  461.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Stereo Pos:",11,
  462.             STEREOPOSPROMPTX,STEREOPOSPROMPTY,ePlain);
  463.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Detune:",7,
  464.             DETUNEPROMPTX,DETUNEPROMPTY,ePlain);
  465.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Surround Pos:",13,
  466.             SURROUNDPOSPROMPTX,SURROUNDPOSPROMPTY,ePlain);
  467.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Duration:",9,
  468.             DURATIONPROMPTX,DURATIONPROMPTY,ePlain);
  469.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Duration Adjust:",16,
  470.             DURATIONADJUSTPROMPTX,DURATIONADJUSTPROMPTY,ePlain);
  471.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Real Pitch:",11,
  472.             REALPITCHPROMPTX,REALPITCHPROMPTY,ePlain);
  473.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Effective Pitch:",16,
  474.             FAKEPITCHPROMPTX,FAKEPITCHPROMPTY,ePlain);
  475.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Portamento:",11,
  476.             PORTAMENTOPROMPTX,PORTAMENTOPROMPTY,ePlain);
  477.     }
  478.  
  479.  
  480. /* show dialog box allowing user to edit note's parameters */
  481. void                        EditNoteParametersDialog(NoteObjectRec* Note, TrackObjectRec* Track)
  482.     {
  483.         WindowRec*                Window;
  484.         char*                            StringTemp;
  485.         MyBoolean                    LoopFlag;
  486.         TextEditRec*            ActiveTextEdit;
  487.         MyBoolean                    DoItFlag EXECUTE(= -31342);
  488.  
  489.         CheckPtrExistence(Note);
  490.  
  491.         Window = (WindowRec*)AllocPtrCanFail(sizeof(WindowRec),"TrackAttributeDialogWindow");
  492.         if (Window == NIL)
  493.             {
  494.              FailurePoint1:
  495.                 AlertHalt("There is not enough memory available to edit the note's attributes.",
  496.                     NIL);
  497.                 return;
  498.             }
  499.  
  500.         Window->ScreenID = MakeNewWindow(eModelessDialogWindow,eWindowNotClosable,
  501.             eWindowNotZoomable,eWindowNotResizable,DialogLeftEdge(WINXSIZE),
  502.             DialogTopEdge(WINYSIZE),WINXSIZE,WINYSIZE,(void (*)(void*))&UpdateTheWindow,Window);
  503.         if (Window->ScreenID == NIL)
  504.             {
  505.              FailurePoint2:
  506.                 ReleasePtr((char*)Window);
  507.                 goto FailurePoint1;
  508.             }
  509.         SetWindowName(Window->ScreenID,"Edit Note");
  510.  
  511.         Window->OKButton = NewSimpleButton(Window->ScreenID,"OK",OKBUTTONX,OKBUTTONY,
  512.             OKBUTTONWIDTH,OKBUTTONHEIGHT);
  513.         if (Window->OKButton == NIL)
  514.             {
  515.              FailurePoint3:
  516.                 KillWindow(Window->ScreenID);
  517.                 goto FailurePoint2;
  518.             }
  519.         SetDefaultButtonState(Window->OKButton,True);
  520.  
  521.         Window->CancelButton = NewSimpleButton(Window->ScreenID,"Cancel",CANCELBUTTONX,
  522.             CANCELBUTTONY,CANCELBUTTONWIDTH,CANCELBUTTONHEIGHT);
  523.         if (Window->CancelButton == NIL)
  524.             {
  525.              FailurePoint4:
  526.                 DisposeSimpleButton(Window->OKButton);
  527.                 goto FailurePoint3;
  528.             }
  529.  
  530.         Window->EarlyLateEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  531.             9,EARLYLATEADJUSTEDITX,EARLYLATEADJUSTEDITY,EARLYLATEADJUSTEDITWIDTH,
  532.             EARLYLATEADJUSTEDITHEIGHT);
  533.         if (Window->EarlyLateEdit == NIL)
  534.             {
  535.              FailurePoint5:
  536.                 DisposeSimpleButton(Window->CancelButton);
  537.                 goto FailurePoint4;
  538.             }
  539.         StringTemp = LongDoubleToString(GetNoteEarlyLateAdjust(Note),7,1e-4,1e6);
  540.         if (StringTemp == NIL)
  541.             {
  542.              FailurePoint6:
  543.                 DisposeTextEdit(Window->EarlyLateEdit);
  544.                 goto FailurePoint5;
  545.             }
  546.         TextEditNewRawData(Window->EarlyLateEdit,StringTemp,SYSTEMLINEFEED);
  547.         ReleasePtr(StringTemp);
  548.         TextEditHasBeenSaved(Window->EarlyLateEdit);
  549.  
  550.         Window->Release1Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  551.             9,RELEASE1EDITX,RELEASE1EDITY,RELEASE1EDITWIDTH,RELEASE1EDITHEIGHT);
  552.         if (Window->Release1Edit == NIL)
  553.             {
  554.              FailurePoint7:
  555.                 goto FailurePoint6;
  556.             }
  557.         StringTemp = LongDoubleToString(GetNoteReleasePoint1(Note),7,1e-4,1e6);
  558.         if (StringTemp == NIL)
  559.             {
  560.              FailurePoint8:
  561.                 DisposeTextEdit(Window->Release1Edit);
  562.                 goto FailurePoint7;
  563.             }
  564.         TextEditNewRawData(Window->Release1Edit,StringTemp,SYSTEMLINEFEED);
  565.         ReleasePtr(StringTemp);
  566.         TextEditHasBeenSaved(Window->Release1Edit);
  567.  
  568.         Window->Release1StartButton = NewRadioButton(Window->ScreenID,"Start",
  569.             RELEASE1STARTBUTTONX,RELEASE1STARTBUTTONY,RELEASE1STARTBUTTONWIDTH,
  570.             RELEASE1STARTBUTTONHEIGHT);
  571.         if (Window->Release1StartButton == NIL)
  572.             {
  573.              FailurePoint9:
  574.                 goto FailurePoint8;
  575.             }
  576.  
  577.         Window->Release1EndButton = NewRadioButton(Window->ScreenID,"End",
  578.             RELEASE1ENDBUTTONX,RELEASE1ENDBUTTONY,RELEASE1ENDBUTTONWIDTH,
  579.             RELEASE1ENDBUTTONHEIGHT);
  580.         if (Window->Release1EndButton == NIL)
  581.             {
  582.              FailurePoint10:
  583.                 DisposeRadioButton(Window->Release1StartButton);
  584.                 goto FailurePoint9;
  585.             }
  586.  
  587.         Window->Release1DefaultButton = NewRadioButton(Window->ScreenID,"Default",
  588.             RELEASE1DEFAULTBUTTONX,RELEASE1DEFAULTBUTTONY,RELEASE1DEFAULTBUTTONWIDTH,
  589.             RELEASE1DEFAULTBUTTONHEIGHT);
  590.         if (Window->Release1DefaultButton == NIL)
  591.             {
  592.              FailurePoint11:
  593.                 DisposeRadioButton(Window->Release1EndButton);
  594.                 goto FailurePoint10;
  595.             }
  596.  
  597.         switch (GetNoteRelease1Origin(Note))
  598.             {
  599.                 default:
  600.                     EXECUTE(PRERR(AllowResume,
  601.                         "EditNoteParametersDialog:  bad release point 1 start/end flag"));
  602.                     break;
  603.                 case eRelease1FromStart:
  604.                     SetRadioButtonState(Window->Release1StartButton,True);
  605.                     break;
  606.                 case eRelease1FromEnd:
  607.                     SetRadioButtonState(Window->Release1EndButton,True);
  608.                     break;
  609.                 case eRelease1FromDefault:
  610.                     SetRadioButtonState(Window->Release1DefaultButton,True);
  611.                     break;
  612.             }
  613.  
  614.         Window->LoudnessEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  615.             9,LOUDNESSEDITX,LOUDNESSEDITY,LOUDNESSEDITWIDTH,LOUDNESSEDITHEIGHT);
  616.         if (Window->LoudnessEdit == NIL)
  617.             {
  618.              FailurePoint12:
  619.                 DisposeRadioButton(Window->Release1DefaultButton);
  620.                 goto FailurePoint11;
  621.             }
  622.         StringTemp = LongDoubleToString(GetNoteOverallLoudnessAdjustment(Note),7,1e-4,1e6);
  623.         if (StringTemp == NIL)
  624.             {
  625.              FailurePoint13:
  626.                 DisposeTextEdit(Window->LoudnessEdit);
  627.                 goto FailurePoint12;
  628.             }
  629.         TextEditNewRawData(Window->LoudnessEdit,StringTemp,SYSTEMLINEFEED);
  630.         ReleasePtr(StringTemp);
  631.         TextEditHasBeenSaved(Window->LoudnessEdit);
  632.  
  633.         Window->Release2Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  634.             9,RELEASE2EDITX,RELEASE2EDITY,RELEASE2EDITWIDTH,RELEASE2EDITHEIGHT);
  635.         if (Window->Release2Edit == NIL)
  636.             {
  637.              FailurePoint14:
  638.                 goto FailurePoint13;
  639.             }
  640.         StringTemp = LongDoubleToString(GetNoteReleasePoint2(Note),7,1e-4,1e6);
  641.         if (StringTemp == NIL)
  642.             {
  643.              FailurePoint15:
  644.                 DisposeTextEdit(Window->Release2Edit);
  645.                 goto FailurePoint14;
  646.             }
  647.         TextEditNewRawData(Window->Release2Edit,StringTemp,SYSTEMLINEFEED);
  648.         ReleasePtr(StringTemp);
  649.         TextEditHasBeenSaved(Window->Release2Edit);
  650.  
  651.         Window->Release2StartButton = NewRadioButton(Window->ScreenID,"Start",
  652.             RELEASE2STARTBUTTONX,RELEASE2STARTBUTTONY,RELEASE2STARTBUTTONWIDTH,
  653.             RELEASE2STARTBUTTONHEIGHT);
  654.         if (Window->Release2StartButton == NIL)
  655.             {
  656.              FailurePoint16:
  657.                 goto FailurePoint15;
  658.             }
  659.  
  660.         Window->Release2EndButton = NewRadioButton(Window->ScreenID,"End",
  661.             RELEASE2ENDBUTTONX,RELEASE2ENDBUTTONY,RELEASE2ENDBUTTONWIDTH,
  662.             RELEASE2ENDBUTTONHEIGHT);
  663.         if (Window->Release2EndButton == NIL)
  664.             {
  665.              FailurePoint17:
  666.                 DisposeRadioButton(Window->Release2StartButton);
  667.                 goto FailurePoint16;
  668.             }
  669.  
  670.         Window->Release2DefaultButton = NewRadioButton(Window->ScreenID,"Default",
  671.             RELEASE2DEFAULTBUTTONX,RELEASE2DEFAULTBUTTONY,RELEASE2DEFAULTBUTTONWIDTH,
  672.             RELEASE2DEFAULTBUTTONHEIGHT);
  673.         if (Window->Release2DefaultButton == NIL)
  674.             {
  675.              FailurePoint18:
  676.                 DisposeRadioButton(Window->Release2EndButton);
  677.                 goto FailurePoint17;
  678.             }
  679.  
  680.         switch (GetNoteRelease2Origin(Note))
  681.             {
  682.                 default:
  683.                     EXECUTE(PRERR(AllowResume,
  684.                         "EditNoteParametersDialog:  bad release point 2 start/end flag"));
  685.                     break;
  686.                 case eRelease2FromStart:
  687.                     SetRadioButtonState(Window->Release2StartButton,True);
  688.                     break;
  689.                 case eRelease2FromEnd:
  690.                     SetRadioButtonState(Window->Release2EndButton,True);
  691.                     break;
  692.                 case eRelease2FromDefault:
  693.                     SetRadioButtonState(Window->Release2DefaultButton,True);
  694.                     break;
  695.             }
  696.  
  697.         Window->Accent1Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  698.             9,ACCENT1EDITX,ACCENT1EDITY,ACCENT1EDITWIDTH,ACCENT1EDITHEIGHT);
  699.         if (Window->Accent1Edit == NIL)
  700.             {
  701.              FailurePoint19:
  702.                 DisposeRadioButton(Window->Release2DefaultButton);
  703.                 goto FailurePoint18;
  704.             }
  705.         StringTemp = LongDoubleToString(GetNoteAccent1(Note),7,1e-4,1e6);
  706.         if (StringTemp == NIL)
  707.             {
  708.              FailurePoint20:
  709.                 DisposeTextEdit(Window->Accent1Edit);
  710.                 goto FailurePoint19;
  711.             }
  712.         TextEditNewRawData(Window->Accent1Edit,StringTemp,SYSTEMLINEFEED);
  713.         ReleasePtr(StringTemp);
  714.         TextEditHasBeenSaved(Window->Accent1Edit);
  715.  
  716.         Window->Accent2Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  717.             9,ACCENT2EDITX,ACCENT2EDITY,ACCENT2EDITWIDTH,ACCENT2EDITHEIGHT);
  718.         if (Window->Accent2Edit == NIL)
  719.             {
  720.              FailurePoint21:
  721.                 goto FailurePoint20;
  722.             }
  723.         StringTemp = LongDoubleToString(GetNoteAccent2(Note),7,1e-4,1e6);
  724.         if (StringTemp == NIL)
  725.             {
  726.              FailurePoint22:
  727.                 DisposeTextEdit(Window->Accent2Edit);
  728.                 goto FailurePoint21;
  729.             }
  730.         TextEditNewRawData(Window->Accent2Edit,StringTemp,SYSTEMLINEFEED);
  731.         ReleasePtr(StringTemp);
  732.         TextEditHasBeenSaved(Window->Accent2Edit);
  733.  
  734.         Window->Accent3Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  735.             9,ACCENT3EDITX,ACCENT3EDITY,ACCENT3EDITWIDTH,ACCENT3EDITHEIGHT);
  736.         if (Window->Accent3Edit == NIL)
  737.             {
  738.              FailurePoint23:
  739.                 goto FailurePoint22;
  740.             }
  741.         StringTemp = LongDoubleToString(GetNoteAccent3(Note),7,1e-4,1e6);
  742.         if (StringTemp == NIL)
  743.             {
  744.              FailurePoint24:
  745.                 DisposeTextEdit(Window->Accent3Edit);
  746.                 goto FailurePoint23;
  747.             }
  748.         TextEditNewRawData(Window->Accent3Edit,StringTemp,SYSTEMLINEFEED);
  749.         ReleasePtr(StringTemp);
  750.         TextEditHasBeenSaved(Window->Accent3Edit);
  751.  
  752.         Window->Accent4Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  753.             9,ACCENT4EDITX,ACCENT4EDITY,ACCENT4EDITWIDTH,ACCENT4EDITHEIGHT);
  754.         if (Window->Accent4Edit == NIL)
  755.             {
  756.              FailurePoint25:
  757.                 goto FailurePoint24;
  758.             }
  759.         StringTemp = LongDoubleToString(GetNoteAccent4(Note),7,1e-4,1e6);
  760.         if (StringTemp == NIL)
  761.             {
  762.              FailurePoint26:
  763.                 DisposeTextEdit(Window->Accent4Edit);
  764.                 goto FailurePoint25;
  765.             }
  766.         TextEditNewRawData(Window->Accent4Edit,StringTemp,SYSTEMLINEFEED);
  767.         ReleasePtr(StringTemp);
  768.         TextEditHasBeenSaved(Window->Accent4Edit);
  769.  
  770.         Window->PitchDispRateEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  771.             GetScreenFont(),9,PITCHDISPRATEEDITX,PITCHDISPRATEEDITY,PITCHDISPRATEEDITWIDTH,
  772.             PTICHDISPRATEEDITHEIGHT);
  773.         if (Window->PitchDispRateEdit == NIL)
  774.             {
  775.              FailurePoint27:
  776.                 goto FailurePoint26;
  777.             }
  778.         StringTemp = LongDoubleToString(GetNotePitchDisplacementRateAdjust(Note),7,1e-4,1e6);
  779.         if (StringTemp == NIL)
  780.             {
  781.              FailurePoint28:
  782.                 DisposeTextEdit(Window->PitchDispRateEdit);
  783.                 goto FailurePoint27;
  784.             }
  785.         TextEditNewRawData(Window->PitchDispRateEdit,StringTemp,SYSTEMLINEFEED);
  786.         ReleasePtr(StringTemp);
  787.         TextEditHasBeenSaved(Window->PitchDispRateEdit);
  788.  
  789.         Window->PitchDispDepthEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  790.             GetScreenFont(),9,PITCHDISPDEPTHEDITX,PITCHDISPDEPTHEDITY,PITCHDISPDEPTHEDITWIDTH,
  791.             PITCHDISPDEPTHEDITHEIGHT);
  792.         if (Window->PitchDispDepthEdit == NIL)
  793.             {
  794.              FailurePoint29:
  795.                 goto FailurePoint28;
  796.             }
  797.         StringTemp = LongDoubleToString(GetNotePitchDisplacementDepthAdjust(Note),
  798.             7,1e-4,1e6);
  799.         if (StringTemp == NIL)
  800.             {
  801.              FailurePoint30:
  802.                 DisposeTextEdit(Window->PitchDispDepthEdit);
  803.                 goto FailurePoint29;
  804.             }
  805.         TextEditNewRawData(Window->PitchDispDepthEdit,StringTemp,SYSTEMLINEFEED);
  806.         ReleasePtr(StringTemp);
  807.         TextEditHasBeenSaved(Window->PitchDispDepthEdit);
  808.  
  809.         Window->HurryUpEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  810.             9,HURRYUPEDITX,HURRYUPEDITY,HURRYUPEDITWIDTH,HURRYUPEDITHEIGHT);
  811.         if (Window->HurryUpEdit == NIL)
  812.             {
  813.              FailurePoint34:
  814.                 goto FailurePoint30;
  815.             }
  816.         StringTemp = LongDoubleToString(GetNoteHurryUpFactor(Note),7,1e-4,1e6);
  817.         if (StringTemp == NIL)
  818.             {
  819.              FailurePoint35:
  820.                 DisposeTextEdit(Window->HurryUpEdit);
  821.                 goto FailurePoint34;
  822.             }
  823.         TextEditNewRawData(Window->HurryUpEdit,StringTemp,SYSTEMLINEFEED);
  824.         ReleasePtr(StringTemp);
  825.         TextEditHasBeenSaved(Window->HurryUpEdit);
  826.  
  827.         Window->PitchDispStartEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  828.             GetScreenFont(),9,PITCHDISPSTARTEDITX,PITCHDISPSTARTEDITY,
  829.             PITCHDISPSTARTEDITWIDTH,PITCHDISPSTARTEDITHEIGHT);
  830.         if (Window->PitchDispStartEdit == NIL)
  831.             {
  832.              FailurePoint36:
  833.                 goto FailurePoint35;
  834.             }
  835.         StringTemp = LongDoubleToString(GetNotePitchDisplacementStartPoint(Note),7,1e-4,1e6);
  836.         if (StringTemp == NIL)
  837.             {
  838.              FailurePoint37:
  839.                 DisposeTextEdit(Window->PitchDispStartEdit);
  840.                 goto FailurePoint36;
  841.             }
  842.         TextEditNewRawData(Window->PitchDispStartEdit,StringTemp,SYSTEMLINEFEED);
  843.         ReleasePtr(StringTemp);
  844.         TextEditHasBeenSaved(Window->PitchDispStartEdit);
  845.  
  846.         Window->PitchDispStartStartButton = NewRadioButton(Window->ScreenID,"Start",
  847.             PITCHDISPSTARTSTARTBUTTONX,PITCHDISPSTARTSTARTBUTTONY,
  848.             PITCHDISPSTARTSTARTBUTTONWIDTH,PITCHDISPSTARTSTARTBUTTONHEIGHT);
  849.         if (Window->PitchDispStartStartButton == NIL)
  850.             {
  851.              FailurePoint38:
  852.                 goto FailurePoint37;
  853.             }
  854.  
  855.         Window->PitchDispStartEndButton = NewRadioButton(Window->ScreenID,"End",
  856.             PITCHDISPSTARTENDBUTTONX,PITCHDISPSTARTENDBUTTONY,
  857.             PITCHDISPSTARTENDBUTTONWIDTH,PITCHDISPSTARTENDBUTTONHEIGHT);
  858.         if (Window->PitchDispStartEndButton == NIL)
  859.             {
  860.              FailurePoint39:
  861.                 DisposeRadioButton(Window->PitchDispStartStartButton);
  862.                 goto FailurePoint38;
  863.             }
  864.  
  865.         Window->PitchDispStartDefaultButton = NewRadioButton(Window->ScreenID,"Default",
  866.             PITCHDISPSTARTDEFAULTBUTTONX,PITCHDISPSTARTDEFAULTBUTTONY,
  867.             PITCHDISPSTARTDEFAULTBUTTONWIDTH,PITCHDISPSTARTDEFAULTBUTTONHEIGHT);
  868.         if (Window->PitchDispStartDefaultButton == NIL)
  869.             {
  870.              FailurePoint40:
  871.                 DisposeRadioButton(Window->PitchDispStartEndButton);
  872.                 goto FailurePoint39;
  873.             }
  874.  
  875.         switch (GetNotePitchDisplacementStartOrigin(Note))
  876.             {
  877.                 default:
  878.                     EXECUTE(PRERR(AllowResume,
  879.                         "EditNoteParametersDialog:  bad pitch disp start origin flag"));
  880.                     break;
  881.                 case ePitchDisplacementStartFromStart:
  882.                     SetRadioButtonState(Window->PitchDispStartStartButton,True);
  883.                     break;
  884.                 case ePitchDisplacementStartFromEnd:
  885.                     SetRadioButtonState(Window->PitchDispStartEndButton,True);
  886.                     break;
  887.                 case ePitchDisplacementStartFromDefault:
  888.                     SetRadioButtonState(Window->PitchDispStartDefaultButton,True);
  889.                     break;
  890.             }
  891.  
  892.         Window->StereoPosEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  893.             GetScreenFont(),9,STEREOPOSEDITX,STEREOPOSEDITY,STEREOPOSEDITWIDTH,
  894.             STEREOPOSEDITHEIGHT);
  895.         if (Window->StereoPosEdit == NIL)
  896.             {
  897.              FailurePoint41:
  898.                 DisposeRadioButton(Window->PitchDispStartDefaultButton);
  899.                 goto FailurePoint40;
  900.             }
  901.         StringTemp = LongDoubleToString(GetNoteStereoPositioning(Note),7,1e-4,1e6);
  902.         if (StringTemp == NIL)
  903.             {
  904.              FailurePoint42:
  905.                 DisposeTextEdit(Window->StereoPosEdit);
  906.                 goto FailurePoint41;
  907.             }
  908.         TextEditNewRawData(Window->StereoPosEdit,StringTemp,SYSTEMLINEFEED);
  909.         ReleasePtr(StringTemp);
  910.         TextEditHasBeenSaved(Window->StereoPosEdit);
  911.  
  912.         Window->DetuneEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  913.             9,DETUNEEDITX,DETUNEEDITY,DETUNEEDITWIDTH,DETUNEEDITHEIGHT);
  914.         if (Window->DetuneEdit == NIL)
  915.             {
  916.              FailurePoint43:
  917.                 goto FailurePoint42;
  918.             }
  919.         StringTemp = LongDoubleToString(GetNoteDetuning(Note),7,1e-4,1e6);
  920.         if (StringTemp == NIL)
  921.             {
  922.              FailurePoint44:
  923.                 DisposeTextEdit(Window->DetuneEdit);
  924.                 goto FailurePoint43;
  925.             }
  926.         TextEditNewRawData(Window->DetuneEdit,StringTemp,SYSTEMLINEFEED);
  927.         ReleasePtr(StringTemp);
  928.         TextEditHasBeenSaved(Window->DetuneEdit);
  929.  
  930.         Window->DetuneHertzButton = NewRadioButton(Window->ScreenID,"Hertz",
  931.             DETUNEHERTZBUTTONX,DETUNEHERTZBUTTONY,DETUNEHERTZBUTTONWIDTH,
  932.             DETUNEHERTZBUTTONHEIGHT);
  933.         if (Window->DetuneHertzButton == NIL)
  934.             {
  935.              FailurePoint45:
  936.                 goto FailurePoint44;
  937.             }
  938.  
  939.         Window->DetuneHalfstepButton = NewRadioButton(Window->ScreenID,"Halfsteps",
  940.             DETUNEHALFSTEPBUTTONX,DETUNEHALFSTEPBUTTONY,DETUNEHALFSTEPBUTTONWIDTH,
  941.             DETUNEHALFSTEPBUTTONHEIGHT);
  942.         if (Window->DetuneHalfstepButton == NIL)
  943.             {
  944.              FailurePoint46:
  945.                 DisposeRadioButton(Window->DetuneHertzButton);
  946.                 goto FailurePoint45;
  947.             }
  948.  
  949.         Window->DetuneDefaultButton = NewRadioButton(Window->ScreenID,"Default",
  950.             DETUNEDEFAULTBUTTONX,DETUNEDEFAULTBUTTONY,DETUNEDEFAULTBUTTONWIDTH,
  951.             DETUNEDEFAULTBUTTONHEIGHT);
  952.         if (Window->DetuneDefaultButton == NIL)
  953.             {
  954.              FailurePoint47:
  955.                 DisposeRadioButton(Window->DetuneHalfstepButton);
  956.                 goto FailurePoint46;
  957.             }
  958.  
  959.         switch (GetNoteDetuneConversionMode(Note))
  960.             {
  961.                 default:
  962.                     EXECUTE(PRERR(AllowResume,
  963.                         "EditNoteParametersDialog:  bad detune conversion mode flag"));
  964.                     break;
  965.                 case eDetuningModeHertz:
  966.                     SetRadioButtonState(Window->DetuneHertzButton,True);
  967.                     break;
  968.                 case eDetuningModeHalfSteps:
  969.                     SetRadioButtonState(Window->DetuneHalfstepButton,True);
  970.                     break;
  971.                 case eDetuningModeDefault:
  972.                     SetRadioButtonState(Window->DetuneDefaultButton,True);
  973.                     break;
  974.             }
  975.  
  976.         Window->DurationEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  977.             GetScreenFont(),9,DURATIONEDITX,DURATIONEDITY,DURATIONEDITWIDTH,
  978.             DURATIONEDITHEIGHT);
  979.         if (Window->DurationEdit == NIL)
  980.             {
  981.              FailurePoint48:
  982.                 DisposeRadioButton(Window->DetuneDefaultButton);
  983.                 goto FailurePoint47;
  984.             }
  985.         StringTemp = NumericDurationToString(GetNoteDuration(Note),GetNoteDotStatus(Note),
  986.             GetNoteDurationDivision(Note));
  987.         if (StringTemp == NIL)
  988.             {
  989.              FailurePoint49:
  990.                 DisposeTextEdit(Window->DurationEdit);
  991.                 goto FailurePoint48;
  992.             }
  993.         TextEditNewRawData(Window->DurationEdit,StringTemp,SYSTEMLINEFEED);
  994.         ReleasePtr(StringTemp);
  995.         TextEditHasBeenSaved(Window->DurationEdit);
  996.  
  997.         Window->DurationAdjustEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  998.             GetScreenFont(),9,DURATIONADJUSTEDITX,DURATIONADJUSTEDITY,
  999.             DURATIONADJUSTEDITWIDTH,DURATIONADJUSTEDITHEIGHT);
  1000.         if (Window->DurationAdjustEdit == NIL)
  1001.             {
  1002.              FailurePoint50:
  1003.                 goto FailurePoint49;
  1004.             }
  1005.         StringTemp = LongDoubleToString(GetNoteDurationAdjust(Note),7,1e-4,1e6);
  1006.         if (StringTemp == NIL)
  1007.             {
  1008.              FailurePoint51:
  1009.                 DisposeTextEdit(Window->DurationAdjustEdit);
  1010.                 goto FailurePoint50;
  1011.             }
  1012.         TextEditNewRawData(Window->DurationAdjustEdit,StringTemp,SYSTEMLINEFEED);
  1013.         ReleasePtr(StringTemp);
  1014.         TextEditHasBeenSaved(Window->DurationAdjustEdit);
  1015.  
  1016.         Window->DurationAdjustAddButton = NewRadioButton(Window->ScreenID,"Add",
  1017.             DURATIONADJUSTADDBUTTONX,DURATIONADJUSTADDBUTTONY,DURATIONADJUSTADDBUTTONWIDTH,
  1018.             DURATIONADJUSTADDBUTTONHEIGHT);
  1019.         if (Window->DurationAdjustAddButton == NIL)
  1020.             {
  1021.              FailurePoint52:
  1022.                 goto FailurePoint51;
  1023.             }
  1024.  
  1025.         Window->DurationAdjustMultButton = NewRadioButton(Window->ScreenID,"Mult",
  1026.             DURATIONADJUSTMULTBUTTONX,DURATIONADJUSTMULTBUTTONY,DURATIONADJUSTMULTBUTTONWIDTH,
  1027.             DURATIONADJUSTMULTBOTTONHEIGHT);
  1028.         if (Window->DurationAdjustMultButton == NIL)
  1029.             {
  1030.              FailurePoint53:
  1031.                 DisposeRadioButton(Window->DurationAdjustAddButton);
  1032.                 goto FailurePoint52;
  1033.             }
  1034.  
  1035.         Window->DurationAdjustDefaultButton = NewRadioButton(Window->ScreenID,"Default",
  1036.             DURATIONADJUSTDEFAULTBUTTONX,DURATIONADJUSTDEFAULTBUTTONY,
  1037.             DURATIONADJUSTDEFAULTBUTTONWIDTH,DURATIONADJUSTDEFAULTBUTTONHEIGHT);
  1038.         if (Window->DurationAdjustDefaultButton == NIL)
  1039.             {
  1040.              FailurePoint54:
  1041.                 DisposeRadioButton(Window->DurationAdjustMultButton);
  1042.                 goto FailurePoint53;
  1043.             }
  1044.  
  1045.         switch (GetNoteDurationAdjustMode(Note))
  1046.             {
  1047.                 default:
  1048.                     EXECUTE(PRERR(AllowResume,
  1049.                         "EditNoteParametersDialog:  bad duration adjust mode flag"));
  1050.                     break;
  1051.                 case eDurationAdjustAdditive:
  1052.                     SetRadioButtonState(Window->DurationAdjustAddButton,True);
  1053.                     break;
  1054.                 case eDurationAdjustMultiplicative:
  1055.                     SetRadioButtonState(Window->DurationAdjustMultButton,True);
  1056.                     break;
  1057.                 case eDurationAdjustDefault:
  1058.                     SetRadioButtonState(Window->DurationAdjustDefaultButton,True);
  1059.                     break;
  1060.             }
  1061.  
  1062.         Window->RealPitchEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1063.             GetScreenFont(),9,REALPITCHEDITX,REALPITCHEDITY,REALPITCHEDITWIDTH,
  1064.             REALPITCHEDITHEIGHT);
  1065.         if (Window->RealPitchEdit == NIL)
  1066.             {
  1067.              FailurePoint55:
  1068.                 DisposeRadioButton(Window->DurationAdjustDefaultButton);
  1069.                 goto FailurePoint54;
  1070.             }
  1071.         StringTemp = NumericPitchToString(GetNotePitch(Note),GetNoteFlatOrSharpStatus(Note));
  1072.         if (StringTemp == NIL)
  1073.             {
  1074.              FailurePoint56:
  1075.                 DisposeTextEdit(Window->RealPitchEdit);
  1076.                 goto FailurePoint55;
  1077.             }
  1078.         TextEditNewRawData(Window->RealPitchEdit,StringTemp,SYSTEMLINEFEED);
  1079.         ReleasePtr(StringTemp);
  1080.         TextEditHasBeenSaved(Window->RealPitchEdit);
  1081.  
  1082.         Window->FakePitchEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1083.             GetScreenFont(),9,FAKEPITCHEDITX,FAKEPITCHEDITY,FAKEPITCHEDITWIDTH,
  1084.             FAKEPITCHEDITHEIGHT);
  1085.         if (Window->FakePitchEdit == NIL)
  1086.             {
  1087.              FailurePoint57:
  1088.                 goto FailurePoint56;
  1089.             }
  1090.         if (GetNoteMultisampleFalsePitch(Note) == -1)
  1091.             {
  1092.                 /* default */
  1093.                 StringTemp = StringToBlockCopy("default");
  1094.             }
  1095.          else
  1096.             {
  1097.                 StringTemp = NumericPitchToString(GetNoteMultisampleFalsePitch(Note),0);
  1098.             }
  1099.         if (StringTemp == NIL)
  1100.             {
  1101.              FailurePoint58:
  1102.                 DisposeTextEdit(Window->FakePitchEdit);
  1103.                 goto FailurePoint57;
  1104.             }
  1105.         TextEditNewRawData(Window->FakePitchEdit,StringTemp,SYSTEMLINEFEED);
  1106.         ReleasePtr(StringTemp);
  1107.         TextEditHasBeenSaved(Window->FakePitchEdit);
  1108.  
  1109.         Window->PortamentoEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1110.             GetScreenFont(),9,PORTAMENTOEDITX,PORTAMENTOEDITY,PORTAMENTOEDITWIDTH,
  1111.             PORTAMENTOEDITHEIGHT);
  1112.         if (Window->PortamentoEdit == NIL)
  1113.             {
  1114.              FailurePoint59:
  1115.                 goto FailurePoint58;
  1116.             }
  1117.         StringTemp = LongDoubleToString(GetNotePortamentoDuration(Note),7,1e-4,1e6);
  1118.         if (StringTemp == NIL)
  1119.             {
  1120.              FailurePoint60:
  1121.                 DisposeTextEdit(Window->PortamentoEdit);
  1122.                 goto FailurePoint59;
  1123.             }
  1124.         TextEditNewRawData(Window->PortamentoEdit,StringTemp,SYSTEMLINEFEED);
  1125.         ReleasePtr(StringTemp);
  1126.         TextEditHasBeenSaved(Window->PortamentoEdit);
  1127.  
  1128.         Window->RestBox = NewCheckBox(Window->ScreenID,"Note Is Actually a Rest",
  1129.             RESTCHECKBOXX,RESTCHECKBOXY,RESTCHECKBOXWIDTH,RESTCHECKBOXHEIGHT);
  1130.         if (Window->RestBox == NIL)
  1131.             {
  1132.              FailurePoint61:
  1133.                 goto FailurePoint60;
  1134.             }
  1135.         if (GetNoteIsItARest(Note))
  1136.             {
  1137.                 SetCheckBoxState(Window->RestBox,True);
  1138.             }
  1139.  
  1140.         Window->PortaHertzButton = NewRadioButton(Window->ScreenID,"Hertz",
  1141.             PORTAHERTZBUTTONX,PORTAHERTZBUTTONY,PORTAHERTZBUTTONWIDTH,PORTAHERTZBUTTONHEIGHT);
  1142.         if (Window->PortaHertzButton == NIL)
  1143.             {
  1144.              FailurePoint62:
  1145.                 DisposeCheckBox(Window->RestBox);
  1146.                 goto FailurePoint61;
  1147.             }
  1148.  
  1149.         Window->PortaHalfstepButton = NewRadioButton(Window->ScreenID,"Halfsteps",
  1150.             PORTAHALFSTEPBUTTONX,PORTAHALFSTEPBUTTONY,PORTAHALFSTEPBUTTONWIDTH,
  1151.             PORTAHALFSTEPBUTTONHEIGHT);
  1152.         if (Window->PortaHalfstepButton == NIL)
  1153.             {
  1154.              FailurePoint63:
  1155.                 DisposeRadioButton(Window->PortaHertzButton);
  1156.                 goto FailurePoint62;
  1157.             }
  1158.  
  1159.         if (GetNotePortamentoHertzNotHalfstepsFlag(Note))
  1160.             {
  1161.                 SetRadioButtonState(Window->PortaHertzButton,True);
  1162.             }
  1163.          else
  1164.             {
  1165.                 SetRadioButtonState(Window->PortaHalfstepButton,True);
  1166.             }
  1167.  
  1168.         Window->RetrigBox = NewCheckBox(Window->ScreenID,"Retrigger Envelopes on Tie",
  1169.             RETRIGCHECKBOXX,RETRIGCHECKBOXY,RETRIGCHECKBOXWIDTH,RETRIGCHECKBOXHEIGHT);
  1170.         if (Window->RetrigBox == NIL)
  1171.             {
  1172.              FailurePoint64:
  1173.                 DisposeRadioButton(Window->PortaHalfstepButton);
  1174.                 goto FailurePoint63;
  1175.             }
  1176.         if (GetNoteRetriggerEnvelopesOnTieStatus(Note))
  1177.             {
  1178.                 SetCheckBoxState(Window->RetrigBox,True);
  1179.             }
  1180.  
  1181.         Window->Release3Box = NewCheckBox(Window->ScreenID,
  1182.             "Release 3 From Start Instead Of End",RELEASE3CHECKBOXX,RELEASE3CHECKBOXY,
  1183.             RELEASE3CHECKBOXWIDTH,RELEASE3CHECKBOXHEIGHT);
  1184.         if (Window->Release3Box == NIL)
  1185.             {
  1186.              FailurePoint65:
  1187.                 DisposeCheckBox(Window->RetrigBox);
  1188.                 goto FailurePoint64;
  1189.             }
  1190.         if (GetNoteRelease3FromStartInsteadOfEnd(Note))
  1191.             {
  1192.                 SetCheckBoxState(Window->Release3Box,True);
  1193.             }
  1194.  
  1195.         Window->SurroundPosEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1196.             GetScreenFont(),9,SURROUNDPOSEDITX,SURROUNDPOSEDITY,SURROUNDPOSEDITWIDTH,
  1197.             SURROUNDPOSEDITHEIGHT);
  1198.         if (Window->SurroundPosEdit == NIL)
  1199.             {
  1200.              FailurePoint66:
  1201.                 DisposeCheckBox(Window->Release3Box);
  1202.                 goto FailurePoint65;
  1203.             }
  1204.         StringTemp = LongDoubleToString(GetNoteSurroundPositioning(Note),7,1e-4,1e6);
  1205.         if (StringTemp == NIL)
  1206.             {
  1207.              FailurePoint67:
  1208.                 DisposeTextEdit(Window->SurroundPosEdit);
  1209.                 goto FailurePoint66;
  1210.             }
  1211.         TextEditNewRawData(Window->SurroundPosEdit,StringTemp,SYSTEMLINEFEED);
  1212.         ReleasePtr(StringTemp);
  1213.         TextEditHasBeenSaved(Window->SurroundPosEdit);
  1214.  
  1215.  
  1216.         ActiveTextEdit = Window->EarlyLateEdit;
  1217.         EnableTextEditSelection(ActiveTextEdit);
  1218.         TextEditDoMenuSelectAll(ActiveTextEdit);
  1219.         LoopFlag = True;
  1220.         while (LoopFlag)
  1221.             {
  1222.                 OrdType                            X;
  1223.                 OrdType                            Y;
  1224.                 ModifierFlags                Modifiers;
  1225.                 MenuItemType*                MenuItem;
  1226.                 char                                KeyPress;
  1227.  
  1228.                 switch (GetAnEvent(&X,&Y,&Modifiers,NIL,&MenuItem,&KeyPress))
  1229.                     {
  1230.                         default:
  1231.                             break;
  1232.                         case eCheckCursor:
  1233.                             if (TextEditIBeamTest(Window->EarlyLateEdit,X,Y)
  1234.                                 || TextEditIBeamTest(Window->Release1Edit,X,Y)
  1235.                                 || TextEditIBeamTest(Window->LoudnessEdit,X,Y)
  1236.                                 || TextEditIBeamTest(Window->Release2Edit,X,Y)
  1237.                                 || TextEditIBeamTest(Window->Accent1Edit,X,Y)
  1238.                                 || TextEditIBeamTest(Window->Accent2Edit,X,Y)
  1239.                                 || TextEditIBeamTest(Window->Accent3Edit,X,Y)
  1240.                                 || TextEditIBeamTest(Window->Accent4Edit,X,Y)
  1241.                                 || TextEditIBeamTest(Window->PitchDispRateEdit,X,Y)
  1242.                                 || TextEditIBeamTest(Window->PitchDispDepthEdit,X,Y)
  1243.                                 || TextEditIBeamTest(Window->HurryUpEdit,X,Y)
  1244.                                 || TextEditIBeamTest(Window->PitchDispStartEdit,X,Y)
  1245.                                 || TextEditIBeamTest(Window->StereoPosEdit,X,Y)
  1246.                                 || TextEditIBeamTest(Window->SurroundPosEdit,X,Y)
  1247.                                 || TextEditIBeamTest(Window->DetuneEdit,X,Y)
  1248.                                 || TextEditIBeamTest(Window->DurationEdit,X,Y)
  1249.                                 || TextEditIBeamTest(Window->DurationAdjustEdit,X,Y)
  1250.                                 || TextEditIBeamTest(Window->RealPitchEdit,X,Y)
  1251.                                 || TextEditIBeamTest(Window->FakePitchEdit,X,Y)
  1252.                                 || TextEditIBeamTest(Window->PortamentoEdit,X,Y))
  1253.                                 {
  1254.                                     SetIBeamCursor();
  1255.                                 }
  1256.                              else
  1257.                                 {
  1258.                                     SetArrowCursor();
  1259.                                 }
  1260.                             goto UpdateCursorPoint;
  1261.                             break;
  1262.                         case eNoEvent:
  1263.                          UpdateCursorPoint:
  1264.                             TextEditUpdateCursor(ActiveTextEdit);
  1265.                             break;
  1266.                         case eMenuStarting:
  1267.                             EnableMenuItem(mPaste);
  1268.                             if (TextEditIsThereValidSelection(ActiveTextEdit))
  1269.                                 {
  1270.                                     EnableMenuItem(mCut);
  1271.                                     EnableMenuItem(mCopy);
  1272.                                     EnableMenuItem(mClear);
  1273.                                 }
  1274.                             EnableMenuItem(mSelectAll);
  1275.                             if (TextEditCanWeUndo(ActiveTextEdit))
  1276.                                 {
  1277.                                     EnableMenuItem(mUndo);
  1278.                                 }
  1279.                             break;
  1280.                         case eMenuCommand:
  1281.                             if (MenuItem == mPaste)
  1282.                                 {
  1283.                                     TextEditDoMenuPaste(ActiveTextEdit);
  1284.                                 }
  1285.                             else if (MenuItem == mCut)
  1286.                                 {
  1287.                                     TextEditDoMenuCut(ActiveTextEdit);
  1288.                                 }
  1289.                             else if (MenuItem == mCopy)
  1290.                                 {
  1291.                                     TextEditDoMenuCopy(ActiveTextEdit);
  1292.                                 }
  1293.                             else if (MenuItem == mClear)
  1294.                                 {
  1295.                                     TextEditDoMenuClear(ActiveTextEdit);
  1296.                                 }
  1297.                             else if (MenuItem == mUndo)
  1298.                                 {
  1299.                                     TextEditDoMenuUndo(ActiveTextEdit);
  1300.                                     TextEditShowSelection(ActiveTextEdit);
  1301.                                 }
  1302.                             else if (MenuItem == mSelectAll)
  1303.                                 {
  1304.                                     TextEditDoMenuSelectAll(ActiveTextEdit);
  1305.                                 }
  1306.                             else
  1307.                                 {
  1308.                                     EXECUTE(PRERR(AllowResume,
  1309.                                         "EditNoteParametersDialog: Undefined menu option chosen"));
  1310.                                 }
  1311.                             break;
  1312.                         case eKeyPressed:
  1313.                             if (KeyPress == 13)
  1314.                                 {
  1315.                                     FlashButton(Window->OKButton);
  1316.                                     DoItFlag = True;
  1317.                                     LoopFlag = False;
  1318.                                 }
  1319.                             else if (KeyPress == 9)
  1320.                                 {
  1321.                                     DisableTextEditSelection(ActiveTextEdit);
  1322.                                     if ((eShiftKey & Modifiers) == 0)
  1323.                                         {
  1324.                                             /* tab forwards */
  1325.                                             if (ActiveTextEdit == Window->EarlyLateEdit)
  1326.                                                 {
  1327.                                                     ActiveTextEdit = Window->Release1Edit;
  1328.                                                 }
  1329.                                             else if (ActiveTextEdit == Window->Release1Edit)
  1330.                                                 {
  1331.                                                     ActiveTextEdit = Window->LoudnessEdit;
  1332.                                                 }
  1333.                                             else if (ActiveTextEdit == Window->LoudnessEdit)
  1334.                                                 {
  1335.                                                     ActiveTextEdit = Window->Release2Edit;
  1336.                                                 }
  1337.                                             else if (ActiveTextEdit == Window->Release2Edit)
  1338.                                                 {
  1339.                                                     ActiveTextEdit = Window->Accent1Edit;
  1340.                                                 }
  1341.                                             else if (ActiveTextEdit == Window->Accent1Edit)
  1342.                                                 {
  1343.                                                     ActiveTextEdit = Window->Accent2Edit;
  1344.                                                 }
  1345.                                             else if (ActiveTextEdit == Window->Accent2Edit)
  1346.                                                 {
  1347.                                                     ActiveTextEdit = Window->Accent3Edit;
  1348.                                                 }
  1349.                                             else if (ActiveTextEdit == Window->Accent3Edit)
  1350.                                                 {
  1351.                                                     ActiveTextEdit = Window->Accent4Edit;
  1352.                                                 }
  1353.                                             else if (ActiveTextEdit == Window->Accent4Edit)
  1354.                                                 {
  1355.                                                     ActiveTextEdit = Window->PitchDispRateEdit;
  1356.                                                 }
  1357.                                             else if (ActiveTextEdit == Window->PitchDispRateEdit)
  1358.                                                 {
  1359.                                                     ActiveTextEdit = Window->PitchDispDepthEdit;
  1360.                                                 }
  1361.                                             else if (ActiveTextEdit == Window->PitchDispDepthEdit)
  1362.                                                 {
  1363.                                                     ActiveTextEdit = Window->HurryUpEdit;
  1364.                                                 }
  1365.                                             else if (ActiveTextEdit == Window->HurryUpEdit)
  1366.                                                 {
  1367.                                                     ActiveTextEdit = Window->PitchDispStartEdit;
  1368.                                                 }
  1369.                                             else if (ActiveTextEdit == Window->PitchDispStartEdit)
  1370.                                                 {
  1371.                                                     ActiveTextEdit = Window->StereoPosEdit;
  1372.                                                 }
  1373.                                             else if (ActiveTextEdit == Window->StereoPosEdit)
  1374.                                                 {
  1375.                                                     ActiveTextEdit = Window->DetuneEdit;
  1376.                                                 }
  1377.                                             else if (ActiveTextEdit == Window->DetuneEdit)
  1378.                                                 {
  1379.                                                     ActiveTextEdit = Window->SurroundPosEdit;
  1380.                                                 }
  1381.                                             else if (ActiveTextEdit == Window->SurroundPosEdit)
  1382.                                                 {
  1383.                                                     ActiveTextEdit = Window->DurationEdit;
  1384.                                                 }
  1385.                                             else if (ActiveTextEdit == Window->DurationEdit)
  1386.                                                 {
  1387.                                                     ActiveTextEdit = Window->DurationAdjustEdit;
  1388.                                                 }
  1389.                                             else if (ActiveTextEdit == Window->DurationAdjustEdit)
  1390.                                                 {
  1391.                                                     ActiveTextEdit = Window->RealPitchEdit;
  1392.                                                 }
  1393.                                             else if (ActiveTextEdit == Window->RealPitchEdit)
  1394.                                                 {
  1395.                                                     ActiveTextEdit = Window->FakePitchEdit;
  1396.                                                 }
  1397.                                             else if (ActiveTextEdit == Window->FakePitchEdit)
  1398.                                                 {
  1399.                                                     ActiveTextEdit = Window->PortamentoEdit;
  1400.                                                 }
  1401.                                             else
  1402.                                                 {
  1403.                                                     ActiveTextEdit = Window->EarlyLateEdit;
  1404.                                                 }
  1405.                                         }
  1406.                                      else
  1407.                                         {
  1408.                                             /* tab backwards */
  1409.                                             if (ActiveTextEdit == Window->PortamentoEdit)
  1410.                                                 {
  1411.                                                     ActiveTextEdit = Window->FakePitchEdit;
  1412.                                                 }
  1413.                                             else if (ActiveTextEdit == Window->FakePitchEdit)
  1414.                                                 {
  1415.                                                     ActiveTextEdit = Window->RealPitchEdit;
  1416.                                                 }
  1417.                                             else if (ActiveTextEdit == Window->RealPitchEdit)
  1418.                                                 {
  1419.                                                     ActiveTextEdit = Window->DurationAdjustEdit;
  1420.                                                 }
  1421.                                             else if (ActiveTextEdit == Window->DurationAdjustEdit)
  1422.                                                 {
  1423.                                                     ActiveTextEdit = Window->DurationEdit;
  1424.                                                 }
  1425.                                             else if (ActiveTextEdit == Window->DurationEdit)
  1426.                                                 {
  1427.                                                     ActiveTextEdit = Window->SurroundPosEdit;
  1428.                                                 }
  1429.                                             else if (ActiveTextEdit == Window->SurroundPosEdit)
  1430.                                                 {
  1431.                                                     ActiveTextEdit = Window->DetuneEdit;
  1432.                                                 }
  1433.                                             else if (ActiveTextEdit == Window->DetuneEdit)
  1434.                                                 {
  1435.                                                     ActiveTextEdit = Window->StereoPosEdit;
  1436.                                                 }
  1437.                                             else if (ActiveTextEdit == Window->StereoPosEdit)
  1438.                                                 {
  1439.                                                     ActiveTextEdit = Window->PitchDispStartEdit;
  1440.                                                 }
  1441.                                             else if (ActiveTextEdit == Window->PitchDispStartEdit)
  1442.                                                 {
  1443.                                                     ActiveTextEdit = Window->HurryUpEdit;
  1444.                                                 }
  1445.                                             else if (ActiveTextEdit == Window->HurryUpEdit)
  1446.                                                 {
  1447.                                                     ActiveTextEdit = Window->PitchDispDepthEdit;
  1448.                                                 }
  1449.                                             else if (ActiveTextEdit == Window->PitchDispDepthEdit)
  1450.                                                 {
  1451.                                                     ActiveTextEdit = Window->PitchDispRateEdit;
  1452.                                                 }
  1453.                                             else if (ActiveTextEdit == Window->PitchDispRateEdit)
  1454.                                                 {
  1455.                                                     ActiveTextEdit = Window->Accent4Edit;
  1456.                                                 }
  1457.                                             else if (ActiveTextEdit == Window->Accent4Edit)
  1458.                                                 {
  1459.                                                     ActiveTextEdit = Window->Accent3Edit;
  1460.                                                 }
  1461.                                             else if (ActiveTextEdit == Window->Accent3Edit)
  1462.                                                 {
  1463.                                                     ActiveTextEdit = Window->Accent2Edit;
  1464.                                                 }
  1465.                                             else if (ActiveTextEdit == Window->Accent2Edit)
  1466.                                                 {
  1467.                                                     ActiveTextEdit = Window->Accent1Edit;
  1468.                                                 }
  1469.                                             else if (ActiveTextEdit == Window->Accent1Edit)
  1470.                                                 {
  1471.                                                     ActiveTextEdit = Window->Release2Edit;
  1472.                                                 }
  1473.                                             else if (ActiveTextEdit == Window->Release2Edit)
  1474.                                                 {
  1475.                                                     ActiveTextEdit = Window->LoudnessEdit;
  1476.                                                 }
  1477.                                             else if (ActiveTextEdit == Window->LoudnessEdit)
  1478.                                                 {
  1479.                                                     ActiveTextEdit = Window->Release1Edit;
  1480.                                                 }
  1481.                                             else if (ActiveTextEdit == Window->Release1Edit)
  1482.                                                 {
  1483.                                                     ActiveTextEdit = Window->EarlyLateEdit;
  1484.                                                 }
  1485.                                             else
  1486.                                                 {
  1487.                                                     ActiveTextEdit = Window->PortamentoEdit;
  1488.                                                 }
  1489.                                         }
  1490.                                     TextEditDoMenuSelectAll(ActiveTextEdit);
  1491.                                     EnableTextEditSelection(ActiveTextEdit);
  1492.                                 }
  1493.                             else if (KeyPress == eCancelKey)
  1494.                                 {
  1495.                                     FlashButton(Window->CancelButton);
  1496.                                     DoItFlag = False;
  1497.                                     LoopFlag = False;
  1498.                                 }
  1499.                             else
  1500.                                 {
  1501.                                     TextEditDoKeyPressed(ActiveTextEdit,KeyPress,Modifiers);
  1502.                                 }
  1503.                             break;
  1504.                         case eMouseDown:
  1505.                             if (SimpleButtonHitTest(Window->OKButton,X,Y))
  1506.                                 {
  1507.                                     if (SimpleButtonMouseDown(Window->OKButton,X,Y,NIL,NIL))
  1508.                                         {
  1509.                                             DoItFlag = True;
  1510.                                             LoopFlag = False;
  1511.                                         }
  1512.                                 }
  1513.                             else if (SimpleButtonHitTest(Window->CancelButton,X,Y))
  1514.                                 {
  1515.                                     if (SimpleButtonMouseDown(Window->CancelButton,X,Y,NIL,NIL))
  1516.                                         {
  1517.                                             DoItFlag = False;
  1518.                                             LoopFlag = False;
  1519.                                         }
  1520.                                 }
  1521.                             else if (TextEditHitTest(Window->EarlyLateEdit,X,Y))
  1522.                                 {
  1523.                                     if (ActiveTextEdit != Window->EarlyLateEdit)
  1524.                                         {
  1525.                                             DisableTextEditSelection(ActiveTextEdit);
  1526.                                             ActiveTextEdit = Window->EarlyLateEdit;
  1527.                                             EnableTextEditSelection(ActiveTextEdit);
  1528.                                         }
  1529.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1530.                                 }
  1531.                             else if (TextEditHitTest(Window->Release1Edit,X,Y))
  1532.                                 {
  1533.                                     if (ActiveTextEdit != Window->Release1Edit)
  1534.                                         {
  1535.                                             DisableTextEditSelection(ActiveTextEdit);
  1536.                                             ActiveTextEdit = Window->Release1Edit;
  1537.                                             EnableTextEditSelection(ActiveTextEdit);
  1538.                                         }
  1539.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1540.                                 }
  1541.                             else if (RadioButtonHitTest(Window->Release1StartButton,X,Y))
  1542.                                 {
  1543.                                     if (RadioButtonMouseDown(Window->Release1StartButton,X,Y))
  1544.                                         {
  1545.                                             SetRadioButtonState(Window->Release1EndButton,False);
  1546.                                             SetRadioButtonState(Window->Release1DefaultButton,False);
  1547.                                         }
  1548.                                 }
  1549.                             else if (RadioButtonHitTest(Window->Release1EndButton,X,Y))
  1550.                                 {
  1551.                                     if (RadioButtonMouseDown(Window->Release1EndButton,X,Y))
  1552.                                         {
  1553.                                             SetRadioButtonState(Window->Release1StartButton,False);
  1554.                                             SetRadioButtonState(Window->Release1DefaultButton,False);
  1555.                                         }
  1556.                                 }
  1557.                             else if (RadioButtonHitTest(Window->Release1DefaultButton,X,Y))
  1558.                                 {
  1559.                                     if (RadioButtonMouseDown(Window->Release1DefaultButton,X,Y))
  1560.                                         {
  1561.                                             SetRadioButtonState(Window->Release1StartButton,False);
  1562.                                             SetRadioButtonState(Window->Release1EndButton,False);
  1563.                                         }
  1564.                                 }
  1565.                             else if (TextEditHitTest(Window->LoudnessEdit,X,Y))
  1566.                                 {
  1567.                                     if (ActiveTextEdit != Window->LoudnessEdit)
  1568.                                         {
  1569.                                             DisableTextEditSelection(ActiveTextEdit);
  1570.                                             ActiveTextEdit = Window->LoudnessEdit;
  1571.                                             EnableTextEditSelection(ActiveTextEdit);
  1572.                                         }
  1573.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1574.                                 }
  1575.                             else if (TextEditHitTest(Window->Release2Edit,X,Y))
  1576.                                 {
  1577.                                     if (ActiveTextEdit != Window->Release2Edit)
  1578.                                         {
  1579.                                             DisableTextEditSelection(ActiveTextEdit);
  1580.                                             ActiveTextEdit = Window->Release2Edit;
  1581.                                             EnableTextEditSelection(ActiveTextEdit);
  1582.                                         }
  1583.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1584.                                 }
  1585.                             else if (RadioButtonHitTest(Window->Release2StartButton,X,Y))
  1586.                                 {
  1587.                                     if (RadioButtonMouseDown(Window->Release2StartButton,X,Y))
  1588.                                         {
  1589.                                             SetRadioButtonState(Window->Release2EndButton,False);
  1590.                                             SetRadioButtonState(Window->Release2DefaultButton,False);
  1591.                                         }
  1592.                                 }
  1593.                             else if (RadioButtonHitTest(Window->Release2EndButton,X,Y))
  1594.                                 {
  1595.                                     if (RadioButtonMouseDown(Window->Release2EndButton,X,Y))
  1596.                                         {
  1597.                                             SetRadioButtonState(Window->Release2StartButton,False);
  1598.                                             SetRadioButtonState(Window->Release2DefaultButton,False);
  1599.                                         }
  1600.                                 }
  1601.                             else if (RadioButtonHitTest(Window->Release2DefaultButton,X,Y))
  1602.                                 {
  1603.                                     if (RadioButtonMouseDown(Window->Release2DefaultButton,X,Y))
  1604.                                         {
  1605.                                             SetRadioButtonState(Window->Release2StartButton,False);
  1606.                                             SetRadioButtonState(Window->Release2EndButton,False);
  1607.                                         }
  1608.                                 }
  1609.                             else if (TextEditHitTest(Window->Accent1Edit,X,Y))
  1610.                                 {
  1611.                                     if (ActiveTextEdit != Window->Accent1Edit)
  1612.                                         {
  1613.                                             DisableTextEditSelection(ActiveTextEdit);
  1614.                                             ActiveTextEdit = Window->Accent1Edit;
  1615.                                             EnableTextEditSelection(ActiveTextEdit);
  1616.                                         }
  1617.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1618.                                 }
  1619.                             else if (TextEditHitTest(Window->Accent2Edit,X,Y))
  1620.                                 {
  1621.                                     if (ActiveTextEdit != Window->Accent2Edit)
  1622.                                         {
  1623.                                             DisableTextEditSelection(ActiveTextEdit);
  1624.                                             ActiveTextEdit = Window->Accent2Edit;
  1625.                                             EnableTextEditSelection(ActiveTextEdit);
  1626.                                         }
  1627.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1628.                                 }
  1629.                             else if (TextEditHitTest(Window->Accent3Edit,X,Y))
  1630.                                 {
  1631.                                     if (ActiveTextEdit != Window->Accent3Edit)
  1632.                                         {
  1633.                                             DisableTextEditSelection(ActiveTextEdit);
  1634.                                             ActiveTextEdit = Window->Accent3Edit;
  1635.                                             EnableTextEditSelection(ActiveTextEdit);
  1636.                                         }
  1637.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1638.                                 }
  1639.                             else if (TextEditHitTest(Window->Accent4Edit,X,Y))
  1640.                                 {
  1641.                                     if (ActiveTextEdit != Window->Accent4Edit)
  1642.                                         {
  1643.                                             DisableTextEditSelection(ActiveTextEdit);
  1644.                                             ActiveTextEdit = Window->Accent4Edit;
  1645.                                             EnableTextEditSelection(ActiveTextEdit);
  1646.                                         }
  1647.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1648.                                 }
  1649.                             else if (TextEditHitTest(Window->PitchDispRateEdit,X,Y))
  1650.                                 {
  1651.                                     if (ActiveTextEdit != Window->PitchDispRateEdit)
  1652.                                         {
  1653.                                             DisableTextEditSelection(ActiveTextEdit);
  1654.                                             ActiveTextEdit = Window->PitchDispRateEdit;
  1655.                                             EnableTextEditSelection(ActiveTextEdit);
  1656.                                         }
  1657.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1658.                                 }
  1659.                             else if (TextEditHitTest(Window->PitchDispDepthEdit,X,Y))
  1660.                                 {
  1661.                                     if (ActiveTextEdit != Window->PitchDispDepthEdit)
  1662.                                         {
  1663.                                             DisableTextEditSelection(ActiveTextEdit);
  1664.                                             ActiveTextEdit = Window->PitchDispDepthEdit;
  1665.                                             EnableTextEditSelection(ActiveTextEdit);
  1666.                                         }
  1667.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1668.                                 }
  1669.                             else if (TextEditHitTest(Window->HurryUpEdit,X,Y))
  1670.                                 {
  1671.                                     if (ActiveTextEdit != Window->HurryUpEdit)
  1672.                                         {
  1673.                                             DisableTextEditSelection(ActiveTextEdit);
  1674.                                             ActiveTextEdit = Window->HurryUpEdit;
  1675.                                             EnableTextEditSelection(ActiveTextEdit);
  1676.                                         }
  1677.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1678.                                 }
  1679.                             else if (TextEditHitTest(Window->PitchDispStartEdit,X,Y))
  1680.                                 {
  1681.                                     if (ActiveTextEdit != Window->PitchDispStartEdit)
  1682.                                         {
  1683.                                             DisableTextEditSelection(ActiveTextEdit);
  1684.                                             ActiveTextEdit = Window->PitchDispStartEdit;
  1685.                                             EnableTextEditSelection(ActiveTextEdit);
  1686.                                         }
  1687.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1688.                                 }
  1689.                             else if (RadioButtonHitTest(Window->PitchDispStartStartButton,X,Y))
  1690.                                 {
  1691.                                     if (RadioButtonMouseDown(Window->PitchDispStartStartButton,X,Y))
  1692.                                         {
  1693.                                             SetRadioButtonState(Window->PitchDispStartEndButton,False);
  1694.                                             SetRadioButtonState(Window->PitchDispStartDefaultButton,False);
  1695.                                         }
  1696.                                 }
  1697.                             else if (RadioButtonHitTest(Window->PitchDispStartEndButton,X,Y))
  1698.                                 {
  1699.                                     if (RadioButtonMouseDown(Window->PitchDispStartEndButton,X,Y))
  1700.                                         {
  1701.                                             SetRadioButtonState(Window->PitchDispStartStartButton,False);
  1702.                                             SetRadioButtonState(Window->PitchDispStartDefaultButton,False);
  1703.                                         }
  1704.                                 }
  1705.                             else if (RadioButtonHitTest(Window->PitchDispStartDefaultButton,X,Y))
  1706.                                 {
  1707.                                     if (RadioButtonMouseDown(Window->PitchDispStartDefaultButton,X,Y))
  1708.                                         {
  1709.                                             SetRadioButtonState(Window->PitchDispStartStartButton,False);
  1710.                                             SetRadioButtonState(Window->PitchDispStartEndButton,False);
  1711.                                         }
  1712.                                 }
  1713.                             else if (TextEditHitTest(Window->StereoPosEdit,X,Y))
  1714.                                 {
  1715.                                     if (ActiveTextEdit != Window->StereoPosEdit)
  1716.                                         {
  1717.                                             DisableTextEditSelection(ActiveTextEdit);
  1718.                                             ActiveTextEdit = Window->StereoPosEdit;
  1719.                                             EnableTextEditSelection(ActiveTextEdit);
  1720.                                         }
  1721.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1722.                                 }
  1723.                             else if (TextEditHitTest(Window->SurroundPosEdit,X,Y))
  1724.                                 {
  1725.                                     if (ActiveTextEdit != Window->SurroundPosEdit)
  1726.                                         {
  1727.                                             DisableTextEditSelection(ActiveTextEdit);
  1728.                                             ActiveTextEdit = Window->SurroundPosEdit;
  1729.                                             EnableTextEditSelection(ActiveTextEdit);
  1730.                                         }
  1731.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1732.                                 }
  1733.                             else if (TextEditHitTest(Window->DetuneEdit,X,Y))
  1734.                                 {
  1735.                                     if (ActiveTextEdit != Window->DetuneEdit)
  1736.                                         {
  1737.                                             DisableTextEditSelection(ActiveTextEdit);
  1738.                                             ActiveTextEdit = Window->DetuneEdit;
  1739.                                             EnableTextEditSelection(ActiveTextEdit);
  1740.                                         }
  1741.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1742.                                 }
  1743.                             else if (RadioButtonHitTest(Window->DetuneHertzButton,X,Y))
  1744.                                 {
  1745.                                     if (RadioButtonMouseDown(Window->DetuneHertzButton,X,Y))
  1746.                                         {
  1747.                                             SetRadioButtonState(Window->DetuneHalfstepButton,False);
  1748.                                             SetRadioButtonState(Window->DetuneDefaultButton,False);
  1749.                                         }
  1750.                                 }
  1751.                             else if (RadioButtonHitTest(Window->DetuneHalfstepButton,X,Y))
  1752.                                 {
  1753.                                     if (RadioButtonMouseDown(Window->DetuneHalfstepButton,X,Y))
  1754.                                         {
  1755.                                             SetRadioButtonState(Window->DetuneHertzButton,False);
  1756.                                             SetRadioButtonState(Window->DetuneDefaultButton,False);
  1757.                                         }
  1758.                                 }
  1759.                             else if (RadioButtonHitTest(Window->DetuneDefaultButton,X,Y))
  1760.                                 {
  1761.                                     if (RadioButtonMouseDown(Window->DetuneDefaultButton,X,Y))
  1762.                                         {
  1763.                                             SetRadioButtonState(Window->DetuneHertzButton,False);
  1764.                                             SetRadioButtonState(Window->DetuneHalfstepButton,False);
  1765.                                         }
  1766.                                 }
  1767.                             else if (TextEditHitTest(Window->DurationEdit,X,Y))
  1768.                                 {
  1769.                                     if (ActiveTextEdit != Window->DurationEdit)
  1770.                                         {
  1771.                                             DisableTextEditSelection(ActiveTextEdit);
  1772.                                             ActiveTextEdit = Window->DurationEdit;
  1773.                                             EnableTextEditSelection(ActiveTextEdit);
  1774.                                         }
  1775.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1776.                                 }
  1777.                             else if (TextEditHitTest(Window->DurationAdjustEdit,X,Y))
  1778.                                 {
  1779.                                     if (ActiveTextEdit != Window->DurationAdjustEdit)
  1780.                                         {
  1781.                                             DisableTextEditSelection(ActiveTextEdit);
  1782.                                             ActiveTextEdit = Window->DurationAdjustEdit;
  1783.                                             EnableTextEditSelection(ActiveTextEdit);
  1784.                                         }
  1785.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1786.                                 }
  1787.                             else if (RadioButtonHitTest(Window->DurationAdjustAddButton,X,Y))
  1788.                                 {
  1789.                                     if (RadioButtonMouseDown(Window->DurationAdjustAddButton,X,Y))
  1790.                                         {
  1791.                                             SetRadioButtonState(Window->DurationAdjustMultButton,False);
  1792.                                             SetRadioButtonState(Window->DurationAdjustDefaultButton,False);
  1793.                                         }
  1794.                                 }
  1795.                             else if (RadioButtonHitTest(Window->DurationAdjustMultButton,X,Y))
  1796.                                 {
  1797.                                     if (RadioButtonMouseDown(Window->DurationAdjustMultButton,X,Y))
  1798.                                         {
  1799.                                             SetRadioButtonState(Window->DurationAdjustAddButton,False);
  1800.                                             SetRadioButtonState(Window->DurationAdjustDefaultButton,False);
  1801.                                         }
  1802.                                 }
  1803.                             else if (RadioButtonHitTest(Window->DurationAdjustDefaultButton,X,Y))
  1804.                                 {
  1805.                                     if (RadioButtonMouseDown(Window->DurationAdjustDefaultButton,X,Y))
  1806.                                         {
  1807.                                             SetRadioButtonState(Window->DurationAdjustAddButton,False);
  1808.                                             SetRadioButtonState(Window->DurationAdjustMultButton,False);
  1809.                                         }
  1810.                                 }
  1811.                             else if (TextEditHitTest(Window->RealPitchEdit,X,Y))
  1812.                                 {
  1813.                                     if (ActiveTextEdit != Window->RealPitchEdit)
  1814.                                         {
  1815.                                             DisableTextEditSelection(ActiveTextEdit);
  1816.                                             ActiveTextEdit = Window->RealPitchEdit;
  1817.                                             EnableTextEditSelection(ActiveTextEdit);
  1818.                                         }
  1819.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1820.                                 }
  1821.                             else if (TextEditHitTest(Window->FakePitchEdit,X,Y))
  1822.                                 {
  1823.                                     if (ActiveTextEdit != Window->FakePitchEdit)
  1824.                                         {
  1825.                                             DisableTextEditSelection(ActiveTextEdit);
  1826.                                             ActiveTextEdit = Window->FakePitchEdit;
  1827.                                             EnableTextEditSelection(ActiveTextEdit);
  1828.                                         }
  1829.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1830.                                 }
  1831.                             else if (TextEditHitTest(Window->PortamentoEdit,X,Y))
  1832.                                 {
  1833.                                     if (ActiveTextEdit != Window->PortamentoEdit)
  1834.                                         {
  1835.                                             DisableTextEditSelection(ActiveTextEdit);
  1836.                                             ActiveTextEdit = Window->PortamentoEdit;
  1837.                                             EnableTextEditSelection(ActiveTextEdit);
  1838.                                         }
  1839.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1840.                                 }
  1841.                             else if (CheckBoxHitTest(Window->RestBox,X,Y))
  1842.                                 {
  1843.                                     CheckBoxMouseDown(Window->RestBox,X,Y);
  1844.                                 }
  1845.                             else if (RadioButtonHitTest(Window->PortaHertzButton,X,Y))
  1846.                                 {
  1847.                                     if (RadioButtonMouseDown(Window->PortaHertzButton,X,Y))
  1848.                                         {
  1849.                                             SetRadioButtonState(Window->PortaHalfstepButton,False);
  1850.                                         }
  1851.                                 }
  1852.                             else if (RadioButtonHitTest(Window->PortaHalfstepButton,X,Y))
  1853.                                 {
  1854.                                     if (RadioButtonMouseDown(Window->PortaHalfstepButton,X,Y))
  1855.                                         {
  1856.                                             SetRadioButtonState(Window->PortaHertzButton,False);
  1857.                                         }
  1858.                                 }
  1859.                             else if (CheckBoxHitTest(Window->RetrigBox,X,Y))
  1860.                                 {
  1861.                                     CheckBoxMouseDown(Window->RetrigBox,X,Y);
  1862.                                 }
  1863.                             else if (CheckBoxHitTest(Window->Release3Box,X,Y))
  1864.                                 {
  1865.                                     CheckBoxMouseDown(Window->Release3Box,X,Y);
  1866.                                 }
  1867.                             break;
  1868.                     }
  1869.             }
  1870.         ERROR((DoItFlag != True) && (DoItFlag != False),PRERR(ForceAbort,
  1871.             "EditNoteParametersDialog:  DoItFlag is neither true nor false"));
  1872.  
  1873.         if (DoItFlag)
  1874.             {
  1875.                 MyBoolean                    ErrorNoMemory;
  1876.  
  1877.                 /* this is a bit of overkill.  we should only mark the object as altered */
  1878.                 /* if something was actually changed.  and there's no reason to recompute */
  1879.                 /* the entire schedule. */
  1880.                 TrackObjectAltered(Track,0);
  1881.  
  1882.                 ErrorNoMemory = False;
  1883.  
  1884.                 if (TextEditDoesItNeedToBeSaved(Window->EarlyLateEdit))
  1885.                     {
  1886.                         StringTemp = TextEditGetRawData(Window->EarlyLateEdit,SYSTEMLINEFEED);
  1887.                         if (StringTemp == NIL)
  1888.                             {
  1889.                                 ErrorNoMemory = True;
  1890.                             }
  1891.                          else
  1892.                             {
  1893.                                 PutNoteEarlyLateAdjust(Note,StringToLongDouble(StringTemp,
  1894.                                     PtrSize(StringTemp)));
  1895.                                 ReleasePtr(StringTemp);
  1896.                             }
  1897.                     }
  1898.  
  1899.                 if (TextEditDoesItNeedToBeSaved(Window->Release1Edit))
  1900.                     {
  1901.                         StringTemp = TextEditGetRawData(Window->Release1Edit,SYSTEMLINEFEED);
  1902.                         if (StringTemp == NIL)
  1903.                             {
  1904.                                 ErrorNoMemory = True;
  1905.                             }
  1906.                          else
  1907.                             {
  1908.                                 PutNoteReleasePoint1(Note,StringToLongDouble(StringTemp,
  1909.                                     PtrSize(StringTemp)));
  1910.                                 ReleasePtr(StringTemp);
  1911.                             }
  1912.                     }
  1913.  
  1914.                 if (GetRadioButtonState(Window->Release1StartButton))
  1915.                     {
  1916.                         PutNoteRelease1Origin(Note,eRelease1FromStart);
  1917.                     }
  1918.                 else if (GetRadioButtonState(Window->Release1EndButton))
  1919.                     {
  1920.                         PutNoteRelease1Origin(Note,eRelease1FromEnd);
  1921.                     }
  1922.                 else if (GetRadioButtonState(Window->Release1DefaultButton))
  1923.                     {
  1924.                         PutNoteRelease1Origin(Note,eRelease1FromDefault);
  1925.                     }
  1926.                 else
  1927.                     {
  1928.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  release point 1 "
  1929.                             "radio buttons are in an inconsistent state"));
  1930.                     }
  1931.  
  1932.                 if (TextEditDoesItNeedToBeSaved(Window->LoudnessEdit))
  1933.                     {
  1934.                         StringTemp = TextEditGetRawData(Window->LoudnessEdit,SYSTEMLINEFEED);
  1935.                         if (StringTemp == NIL)
  1936.                             {
  1937.                                 ErrorNoMemory = True;
  1938.                             }
  1939.                          else
  1940.                             {
  1941.                                 PutNoteOverallLoudnessAdjustment(Note,StringToLongDouble(StringTemp,
  1942.                                     PtrSize(StringTemp)));
  1943.                                 ReleasePtr(StringTemp);
  1944.                             }
  1945.                     }
  1946.  
  1947.                 if (TextEditDoesItNeedToBeSaved(Window->Release2Edit))
  1948.                     {
  1949.                         StringTemp = TextEditGetRawData(Window->Release2Edit,SYSTEMLINEFEED);
  1950.                         if (StringTemp == NIL)
  1951.                             {
  1952.                                 ErrorNoMemory = True;
  1953.                             }
  1954.                          else
  1955.                             {
  1956.                                 PutNoteReleasePoint2(Note,StringToLongDouble(StringTemp,
  1957.                                     PtrSize(StringTemp)));
  1958.                                 ReleasePtr(StringTemp);
  1959.                             }
  1960.                     }
  1961.  
  1962.                 if (GetRadioButtonState(Window->Release2StartButton))
  1963.                     {
  1964.                         PutNoteRelease2Origin(Note,eRelease2FromStart);
  1965.                     }
  1966.                 else if (GetRadioButtonState(Window->Release2EndButton))
  1967.                     {
  1968.                         PutNoteRelease2Origin(Note,eRelease2FromEnd);
  1969.                     }
  1970.                 else if (GetRadioButtonState(Window->Release2DefaultButton))
  1971.                     {
  1972.                         PutNoteRelease2Origin(Note,eRelease2FromDefault);
  1973.                     }
  1974.                 else
  1975.                     {
  1976.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  release point 2 "
  1977.                             "radio buttons are in an inconsistent state"));
  1978.                     }
  1979.  
  1980.                 if (TextEditDoesItNeedToBeSaved(Window->Accent1Edit))
  1981.                     {
  1982.                         StringTemp = TextEditGetRawData(Window->Accent1Edit,SYSTEMLINEFEED);
  1983.                         if (StringTemp == NIL)
  1984.                             {
  1985.                                 ErrorNoMemory = True;
  1986.                             }
  1987.                          else
  1988.                             {
  1989.                                 PutNoteAccent1(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  1990.                                 ReleasePtr(StringTemp);
  1991.                             }
  1992.                     }
  1993.  
  1994.                 if (TextEditDoesItNeedToBeSaved(Window->Accent2Edit))
  1995.                     {
  1996.                         StringTemp = TextEditGetRawData(Window->Accent2Edit,SYSTEMLINEFEED);
  1997.                         if (StringTemp == NIL)
  1998.                             {
  1999.                                 ErrorNoMemory = True;
  2000.                             }
  2001.                          else
  2002.                             {
  2003.                                 PutNoteAccent2(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2004.                                 ReleasePtr(StringTemp);
  2005.                             }
  2006.                     }
  2007.  
  2008.                 if (TextEditDoesItNeedToBeSaved(Window->Accent3Edit))
  2009.                     {
  2010.                         StringTemp = TextEditGetRawData(Window->Accent3Edit,SYSTEMLINEFEED);
  2011.                         if (StringTemp == NIL)
  2012.                             {
  2013.                                 ErrorNoMemory = True;
  2014.                             }
  2015.                          else
  2016.                             {
  2017.                                 PutNoteAccent3(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2018.                                 ReleasePtr(StringTemp);
  2019.                             }
  2020.                     }
  2021.  
  2022.                 if (TextEditDoesItNeedToBeSaved(Window->Accent4Edit))
  2023.                     {
  2024.                         StringTemp = TextEditGetRawData(Window->Accent4Edit,SYSTEMLINEFEED);
  2025.                         if (StringTemp == NIL)
  2026.                             {
  2027.                                 ErrorNoMemory = True;
  2028.                             }
  2029.                          else
  2030.                             {
  2031.                                 PutNoteAccent4(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2032.                                 ReleasePtr(StringTemp);
  2033.                             }
  2034.                     }
  2035.  
  2036.                 if (TextEditDoesItNeedToBeSaved(Window->PitchDispRateEdit))
  2037.                     {
  2038.                         StringTemp = TextEditGetRawData(Window->PitchDispRateEdit,SYSTEMLINEFEED);
  2039.                         if (StringTemp == NIL)
  2040.                             {
  2041.                                 ErrorNoMemory = True;
  2042.                             }
  2043.                          else
  2044.                             {
  2045.                                 PutNotePitchDisplacementRateAdjust(Note,StringToLongDouble(StringTemp,
  2046.                                     PtrSize(StringTemp)));
  2047.                                 ReleasePtr(StringTemp);
  2048.                             }
  2049.                     }
  2050.  
  2051.                 if (TextEditDoesItNeedToBeSaved(Window->PitchDispDepthEdit))
  2052.                     {
  2053.                         StringTemp = TextEditGetRawData(Window->PitchDispDepthEdit,SYSTEMLINEFEED);
  2054.                         if (StringTemp == NIL)
  2055.                             {
  2056.                                 ErrorNoMemory = True;
  2057.                             }
  2058.                          else
  2059.                             {
  2060.                                 PutNotePitchDisplacementDepthAdjust(Note,StringToLongDouble(StringTemp,
  2061.                                     PtrSize(StringTemp)));
  2062.                                 ReleasePtr(StringTemp);
  2063.                             }
  2064.                     }
  2065.  
  2066.                 if (TextEditDoesItNeedToBeSaved(Window->HurryUpEdit))
  2067.                     {
  2068.                         StringTemp = TextEditGetRawData(Window->HurryUpEdit,SYSTEMLINEFEED);
  2069.                         if (StringTemp == NIL)
  2070.                             {
  2071.                                 ErrorNoMemory = True;
  2072.                             }
  2073.                          else
  2074.                             {
  2075.                                 PutNoteHurryUpFactor(Note,StringToLongDouble(StringTemp,
  2076.                                     PtrSize(StringTemp)));
  2077.                                 ReleasePtr(StringTemp);
  2078.                             }
  2079.                     }
  2080.  
  2081.                 if (TextEditDoesItNeedToBeSaved(Window->PitchDispStartEdit))
  2082.                     {
  2083.                         StringTemp = TextEditGetRawData(Window->PitchDispStartEdit,SYSTEMLINEFEED);
  2084.                         if (StringTemp == NIL)
  2085.                             {
  2086.                                 ErrorNoMemory = True;
  2087.                             }
  2088.                          else
  2089.                             {
  2090.                                 PutNotePitchDisplacementStartPoint(Note,StringToLongDouble(StringTemp,
  2091.                                     PtrSize(StringTemp)));
  2092.                                 ReleasePtr(StringTemp);
  2093.                             }
  2094.                     }
  2095.  
  2096.                 if (GetRadioButtonState(Window->PitchDispStartStartButton))
  2097.                     {
  2098.                         PutNotePitchDisplacementStartOrigin(Note,ePitchDisplacementStartFromStart);
  2099.                     }
  2100.                 else if (GetRadioButtonState(Window->PitchDispStartEndButton))
  2101.                     {
  2102.                         PutNotePitchDisplacementStartOrigin(Note,ePitchDisplacementStartFromEnd);
  2103.                     }
  2104.                 else if (GetRadioButtonState(Window->PitchDispStartDefaultButton))
  2105.                     {
  2106.                         PutNotePitchDisplacementStartOrigin(Note,ePitchDisplacementStartFromDefault);
  2107.                     }
  2108.                 else
  2109.                     {
  2110.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  pitch disp origin "
  2111.                             "radio buttons are in an inconsistent state"));
  2112.                     }
  2113.  
  2114.                 if (TextEditDoesItNeedToBeSaved(Window->StereoPosEdit))
  2115.                     {
  2116.                         StringTemp = TextEditGetRawData(Window->StereoPosEdit,SYSTEMLINEFEED);
  2117.                         if (StringTemp == NIL)
  2118.                             {
  2119.                                 ErrorNoMemory = True;
  2120.                             }
  2121.                          else
  2122.                             {
  2123.                                 PutNoteStereoPositioning(Note,StringToLongDouble(StringTemp,
  2124.                                     PtrSize(StringTemp)));
  2125.                                 ReleasePtr(StringTemp);
  2126.                             }
  2127.                     }
  2128.  
  2129.                 if (TextEditDoesItNeedToBeSaved(Window->SurroundPosEdit))
  2130.                     {
  2131.                         StringTemp = TextEditGetRawData(Window->SurroundPosEdit,SYSTEMLINEFEED);
  2132.                         if (StringTemp == NIL)
  2133.                             {
  2134.                                 ErrorNoMemory = True;
  2135.                             }
  2136.                          else
  2137.                             {
  2138.                                 PutNoteSurroundPositioning(Note,StringToLongDouble(StringTemp,
  2139.                                     PtrSize(StringTemp)));
  2140.                                 ReleasePtr(StringTemp);
  2141.                             }
  2142.                     }
  2143.  
  2144.                 if (TextEditDoesItNeedToBeSaved(Window->DetuneEdit))
  2145.                     {
  2146.                         StringTemp = TextEditGetRawData(Window->DetuneEdit,SYSTEMLINEFEED);
  2147.                         if (StringTemp == NIL)
  2148.                             {
  2149.                                 ErrorNoMemory = True;
  2150.                             }
  2151.                          else
  2152.                             {
  2153.                                 PutNoteDetuning(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2154.                                 ReleasePtr(StringTemp);
  2155.                             }
  2156.                     }
  2157.  
  2158.                 if (GetRadioButtonState(Window->DetuneHertzButton))
  2159.                     {
  2160.                         PutNoteDetuneConversionMode(Note,eDetuningModeHertz);
  2161.                     }
  2162.                 else if (GetRadioButtonState(Window->DetuneHalfstepButton))
  2163.                     {
  2164.                         PutNoteDetuneConversionMode(Note,eDetuningModeHalfSteps);
  2165.                     }
  2166.                 else if (GetRadioButtonState(Window->DetuneDefaultButton))
  2167.                     {
  2168.                         PutNoteDetuneConversionMode(Note,eDetuningModeDefault);
  2169.                     }
  2170.                 else
  2171.                     {
  2172.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  detune conversion "
  2173.                             "mode radio buttons are in an inconsistent state"));
  2174.                     }
  2175.  
  2176.                 if (TextEditDoesItNeedToBeSaved(Window->DurationEdit))
  2177.                     {
  2178.                         StringTemp = TextEditGetRawData(Window->DurationEdit,SYSTEMLINEFEED);
  2179.                         if (StringTemp == NIL)
  2180.                             {
  2181.                                 ErrorNoMemory = True;
  2182.                             }
  2183.                          else
  2184.                             {
  2185.                                 unsigned long                Duration;
  2186.                                 MyBoolean                        DotFlag;
  2187.                                 unsigned long                Division;
  2188.  
  2189.                                 Duration = GetNoteDuration(Note);
  2190.                                 DotFlag = GetNoteDotStatus(Note);
  2191.                                 Division = GetNoteDurationDivision(Note);
  2192.                                 StringToNumericDuration(StringTemp,&Duration,&DotFlag,&Division);
  2193.                                 PutNoteDuration(Note,Duration);
  2194.                                 PutNoteDotStatus(Note,DotFlag);
  2195.                                 PutNoteDurationDivision(Note,Division);
  2196.                                 ReleasePtr(StringTemp);
  2197.                             }
  2198.                     }
  2199.  
  2200.                 if (TextEditDoesItNeedToBeSaved(Window->DurationAdjustEdit))
  2201.                     {
  2202.                         StringTemp = TextEditGetRawData(Window->DurationAdjustEdit,SYSTEMLINEFEED);
  2203.                         if (StringTemp == NIL)
  2204.                             {
  2205.                                 ErrorNoMemory = True;
  2206.                             }
  2207.                          else
  2208.                             {
  2209.                                 PutNoteDurationAdjust(Note,StringToLongDouble(StringTemp,
  2210.                                     PtrSize(StringTemp)));
  2211.                                 ReleasePtr(StringTemp);
  2212.                             }
  2213.                     }
  2214.  
  2215.                 if (GetRadioButtonState(Window->DurationAdjustAddButton))
  2216.                     {
  2217.                         PutNoteDurationAdjustMode(Note,eDurationAdjustAdditive);
  2218.                     }
  2219.                 else if (GetRadioButtonState(Window->DurationAdjustMultButton))
  2220.                     {
  2221.                         PutNoteDurationAdjustMode(Note,eDurationAdjustMultiplicative);
  2222.                     }
  2223.                 else if (GetRadioButtonState(Window->DurationAdjustDefaultButton))
  2224.                     {
  2225.                         PutNoteDurationAdjustMode(Note,eDurationAdjustDefault);
  2226.                     }
  2227.                 else
  2228.                     {
  2229.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  duration adjust mode "
  2230.                             "radio buttons are in an inconsistent state"));
  2231.                     }
  2232.  
  2233.                 if (TextEditDoesItNeedToBeSaved(Window->RealPitchEdit))
  2234.                     {
  2235.                         StringTemp = TextEditGetRawData(Window->RealPitchEdit,SYSTEMLINEFEED);
  2236.                         if (StringTemp == NIL)
  2237.                             {
  2238.                                 ErrorNoMemory = True;
  2239.                             }
  2240.                          else
  2241.                             {
  2242.                                 short                        PitchValue;
  2243.                                 unsigned long        SharpFlatThing;
  2244.  
  2245.                                 PitchValue = GetNotePitch(Note);
  2246.                                 SharpFlatThing = GetNoteFlatOrSharpStatus(Note);
  2247.                                 StringToNumericPitch(StringTemp,&PitchValue,&SharpFlatThing);
  2248.                                 PutNotePitch(Note,PitchValue);
  2249.                                 PutNoteFlatOrSharpStatus(Note,SharpFlatThing);
  2250.                                 ReleasePtr(StringTemp);
  2251.                             }
  2252.                     }
  2253.  
  2254.                 if (TextEditDoesItNeedToBeSaved(Window->FakePitchEdit))
  2255.                     {
  2256.                         StringTemp = TextEditGetRawData(Window->FakePitchEdit,SYSTEMLINEFEED);
  2257.                         if (StringTemp == NIL)
  2258.                             {
  2259.                                 ErrorNoMemory = True;
  2260.                             }
  2261.                          else
  2262.                             {
  2263.                                 if (IsItInThere(StringTemp,"def"/*ault*/))
  2264.                                     {
  2265.                                         PutNoteMultisampleFalsePitch(Note,-1);
  2266.                                     }
  2267.                                  else
  2268.                                     {
  2269.                                         short                        PitchValue;
  2270.                                         unsigned long        SharpFlatThing;
  2271.  
  2272.                                         PitchValue = GetNotePitch(Note);
  2273.                                         SharpFlatThing = 0;
  2274.                                         StringToNumericPitch(StringTemp,&PitchValue,&SharpFlatThing);
  2275.                                         PutNoteMultisampleFalsePitch(Note,PitchValue);
  2276.                                     }
  2277.                                 ReleasePtr(StringTemp);
  2278.                             }
  2279.                     }
  2280.  
  2281.                 if (TextEditDoesItNeedToBeSaved(Window->PortamentoEdit))
  2282.                     {
  2283.                         StringTemp = TextEditGetRawData(Window->PortamentoEdit,SYSTEMLINEFEED);
  2284.                         if (StringTemp == NIL)
  2285.                             {
  2286.                                 ErrorNoMemory = True;
  2287.                             }
  2288.                          else
  2289.                             {
  2290.                                 PutNotePortamentoDuration(Note,StringToLongDouble(StringTemp,
  2291.                                     PtrSize(StringTemp)));
  2292.                                 ReleasePtr(StringTemp);
  2293.                             }
  2294.                     }
  2295.  
  2296.                 PutNoteIsItARest(Note,GetCheckBoxState(Window->RestBox));
  2297.  
  2298.                 if (GetRadioButtonState(Window->PortaHertzButton))
  2299.                     {
  2300.                         PutNotePortamentoHertzNotHalfstepsFlag(Note,True);
  2301.                     }
  2302.                 else if (GetRadioButtonState(Window->PortaHalfstepButton))
  2303.                     {
  2304.                         PutNotePortamentoHertzNotHalfstepsFlag(Note,False);
  2305.                     }
  2306.                 else
  2307.                     {
  2308.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  portamento mode "
  2309.                             "radio buttons are in an inconsistent state"));
  2310.                     }
  2311.  
  2312.                 PutNoteRetriggerEnvelopesOnTieStatus(Note,GetCheckBoxState(Window->RetrigBox));
  2313.  
  2314.                 PutNoteRelease3FromStartInsteadOfEnd(Note,GetCheckBoxState(Window->Release3Box));
  2315.  
  2316.                 if (ErrorNoMemory)
  2317.                     {
  2318.                         AlertHalt("There was not enough memory to save all of the attributes.",NIL);
  2319.                     }
  2320.             }
  2321.  
  2322.         DisposeSimpleButton(Window->OKButton);
  2323.         DisposeSimpleButton(Window->CancelButton);
  2324.         DisposeTextEdit(Window->EarlyLateEdit);
  2325.         DisposeTextEdit(Window->Release1Edit);
  2326.         DisposeRadioButton(Window->Release1StartButton);
  2327.         DisposeRadioButton(Window->Release1EndButton);
  2328.         DisposeRadioButton(Window->Release1DefaultButton);
  2329.         DisposeTextEdit(Window->LoudnessEdit);
  2330.         DisposeTextEdit(Window->Release2Edit);
  2331.         DisposeRadioButton(Window->Release2StartButton);
  2332.         DisposeRadioButton(Window->Release2EndButton);
  2333.         DisposeRadioButton(Window->Release2DefaultButton);
  2334.         DisposeTextEdit(Window->Accent1Edit);
  2335.         DisposeTextEdit(Window->Accent2Edit);
  2336.         DisposeTextEdit(Window->Accent3Edit);
  2337.         DisposeTextEdit(Window->Accent4Edit);
  2338.         DisposeTextEdit(Window->PitchDispRateEdit);
  2339.         DisposeTextEdit(Window->PitchDispDepthEdit);
  2340.         DisposeTextEdit(Window->HurryUpEdit);
  2341.         DisposeTextEdit(Window->PitchDispStartEdit);
  2342.         DisposeRadioButton(Window->PitchDispStartStartButton);
  2343.         DisposeRadioButton(Window->PitchDispStartEndButton);
  2344.         DisposeRadioButton(Window->PitchDispStartDefaultButton);
  2345.         DisposeTextEdit(Window->StereoPosEdit);
  2346.         DisposeTextEdit(Window->DetuneEdit);
  2347.         DisposeRadioButton(Window->DetuneHertzButton);
  2348.         DisposeRadioButton(Window->DetuneHalfstepButton);
  2349.         DisposeRadioButton(Window->DetuneDefaultButton);
  2350.         DisposeTextEdit(Window->SurroundPosEdit);
  2351.         DisposeTextEdit(Window->DurationEdit);
  2352.         DisposeTextEdit(Window->DurationAdjustEdit);
  2353.         DisposeRadioButton(Window->DurationAdjustAddButton);
  2354.         DisposeRadioButton(Window->DurationAdjustMultButton);
  2355.         DisposeRadioButton(Window->DurationAdjustDefaultButton);
  2356.         DisposeTextEdit(Window->RealPitchEdit);
  2357.         DisposeTextEdit(Window->FakePitchEdit);
  2358.         DisposeTextEdit(Window->PortamentoEdit);
  2359.         DisposeCheckBox(Window->RestBox);
  2360.         DisposeRadioButton(Window->PortaHertzButton);
  2361.         DisposeRadioButton(Window->PortaHalfstepButton);
  2362.         DisposeCheckBox(Window->RetrigBox);
  2363.         DisposeCheckBox(Window->Release3Box);
  2364.         KillWindow(Window->ScreenID);
  2365.         ReleasePtr((char*)Window);
  2366.         /* no return value */
  2367.     }
  2368.